>Thanks a lot, this clears up a number of things for me.
>
>Just one more question on this:
>
>can I get the equivalent of using == with a BETWEEN statement? as I get the same problem when using BETWEEN, preferably without SET ANSI ON as it may affect older code.
>
>TIA, Craig.
With or w/o ansi no. Strings are included in a alphabetic sort order and it would mean '2' would come after '103' and before '210' :
myField between '103' and '210'
would get that '2' too. If that's what you really want then OK. I see that you use '103' in your sampling and thus I suspect all are somewhat numeric values. If so then you might be much more comfortable using val() instead :
where val(myField) = 103
where val(myField) between 103 and 210
If field contains some char too (ie: 103, 103R, 19B) you might then make it still numeric sort ordered with functions like padl(), chrtran().
Cetin