• pnr8uk (10/23/2014)


    ...in the input table I have a postcode BETWEEN two values eg: CV1 and CV10 I want to get a third value from the look up table. ...

    There won't be many rows between 'CV1' and 'CV10'. Try 'CV01' and 'CV10'. If you're only working with UK postcodes, the extra coding isn't much.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden