>This is from a real app :
SELECT irsno, urun, ;
> SUM(adet) as adet, ;
> SUM(kilo) as kilo, ;
> .T. AS dummy ;
> FROM fatview ;
> WHERE !EMPTY(irsno) ;
> GROUP BY irsno,urun ;
> ORDER BY 4 ;
> INTO CURSOR q1
Cetin
Hidy Cetin,
That's what I expected. In your example, you're actually in control of what field 4 is. I produce a number of different summary reports (groupings). In each case the group and order by states are controlled by macro substitution, and single (well, because of the complexity of the summaries, three) SQL statements are used (two to create the date, and a third to join result sets).
George
Ubi caritas et amor, deus ibi est