This statement works in VFP 2.6, but i get a "Group By Clause is missing or invalid" error when it is run in VFP 9:
sele lctable as table, lccond as condition, lcsource as grsource, ;
iif(type(lcsource) = "C", padr(alltrim(&lcsource),14), ltrim(trans(&lcsource, "$$$,$$$,$$$.99"))) as total, ;
coun(&lcsource) as cnt, recc() as totl, glc1, glc2, glc3, glc4, glc5, glc6, glnt ;
from datafile where glnt = grcode group by &lcsource into table temp
sele lctable as table, lccond as condition, lcsource as grsource, ;
iif(type(lcsource) = "C", padr(alltrim(&lcsource),14), ltrim(trans(&lcsource, "$$$,$$$,$$$.99"))) as total, ;
coun(&lcsource) as cnt, recc() as totl, glc1, glc2, glc3, glc4, glc5, glc6, glnt ;
from datafile where glnt = grcode group by &lcsource into table temp