Sergey,
Although you suggestion would work, I have found from my experiences that the format of the character field may not always be consistent with padding the zeros. By casting the character field to a numeric then I can be sure to always group as expected. If I was guaranteed the format would be consistent with the padding then your suggestion would be better for performance.
>>The trick here is to set the decimals correctly so the output is formatted as you expect. Here is the code:
>>
>
>LOCAL lCurrentDec
>>lCurrentDec=SET("Decimals")
>>SET DECIMALS TO 0
>>SELECT name,PADL(MIN(VAL(item)),5,"0") as "Start", ;
>> PADL(MAX(VAL(item)),5,"0") as "End" ;
>> FROM MyTable ;
>> GROUP BY name ;
>> into CURSOR curMyTable
>>SET DECIMALS TO &lCurrentDec
>
>
>Wouldn't it be the same as
SELECT name, ;
> MIN(item) as "Start", ;
> MAX(item) as "End" ;
> FROM MyTable ;
> GROUP BY name ;
> into CURSOR curMyTable
?
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi