>Hi Caroline,
>
>>What do you mean BETWEEN(itemId,0,31) is true.
>
>The max possible values for itemId is out of 0-31 range ?
>
>If yes, SELECT ..... return a error and is not applicable.
>
>Hovewer, this is only another solution, but with limitation on itemId range.
>It is faster of your solution only if a index on CustID not exist.
>
>If exist:
>INDEX ON CustID TAG ...
>INDEX ON itemId TAG ...
>
>your solution is the best on VFP.
>
>Fabio
Thanks for all your help but the ItemID will definitely go above 31.
Caroline