ICASE( myfield > 249, 6 ; myfield > 99, 5 ; myfield > 49, 4 ; myfield > 24, 3 ; myfield > 9, 2 ; 1)>You are right, of course! I didn't even think of ICASE() for some reason.
>>>CREATE TABLE myTable (myfield n(10,0)) && myfield will hold values from 1 to 300 >>>APPEND BLANK >>>REPLACE myfield WITH 1 >>>for i = 2 TO 300 >>> APPEND BLANK >>> REPLACE myfield WITH i >>>endfor >>> >>>*--Group myfield by the myfield field myrange 1 = 0->9, 2 = 10->24... >>>SELECT IIF(myfield >= 0 and myfield <=9, 1, ; >>> IIF(myfield >=10 and myfield <=24, 2, ; >>> IIF(myfield >=25 and myfield <=49, 3, ; >>> IIF(myfield >=50 and myfield <=99, 4, ; >>> IIF(myfield >=100 and myfield <=249, 5, 6))))) AS MyRange, Myfield ; >>> FROM MyTable ; >>> INTO CURSOR cTemp1 >>>>>>