>Dear Cetin
>
>Is it possible to use your select statement without using code reference?
>
>You use these lines
>
>between(code, 1100,1900), 1, ;
> between(code, 2000,2900), 2, ;
>
>If there are codes not between then what should we do?
>I mean if codes are between 8100,8900 and between 9100 to 9900 then?
What is the range for your codes?
See my solution of using LEFT(str(code),1) as cCode. If you want a numeric group, you may add
INT(VAL(LEFT(str(code),1)))
If your group is always in the range of 1000 and 9999, then
int(code/1000) as Code would work.
If it's not broken, fix it until it is.
My Blog