>SELECT column27,; > CAST(sum(IIF((column5>0) , column5, 0)) AS N(14,2)) AS File3,; > CAST(sum(IIF((column8>0) , column8, 0)) AS N(14,2)) AS File4,; > CAST(count(IIF((column5>0) , column5, 0)) AS N(4)) AS File5,; > CAST(count(IIF((column8>0) , column8, 0)) AS N(4)) AS File6; > FROM wtable2 ; >GROUP BY column27; >INTO CURSOR crsTest >index on padl(alltr(column27),10,"0") tag aaa >BROW NORMAL >Rick has given you the answer to your question, but I want to point out that you don't need the IIF() for the SUM() calculations. The result will be the same whether you add the zeroes in or not.