main logo
Subject: Re: Sort on group totals
Author: Chester Friesen
Posted: 2007/01/31 22:23:14
 
View Entire Thread
New Search


Vince Teachout wrote:
> I must not be understanding the problem. This works fine for me in vfp7:
> SELECT stylename, sum(units) as sumall FROM gmoodet GROUP BY stylename
> ORDER BY sumall
>
I'm learning here. ;-) That's close, that gives me a one record for
each rider with a "sumall" field showing the total. I need all the
records in the table to show in the report sorted by the order that the
above came up with. i.e., sorted by the Names, but in the order of the
Totals. I hope I'm making sense! Actually the example below should be
descending instead of ascending, but that's an easy part.

Main Heading
Name1
01/01/07 50
01/01/07 25
Total-> 75
Name2
01/01/07 40
01/01/07 44
Total-> 84
Name3
01/01/07 45
01/01/07 44
Total-> 89

--
Regards,
Chester Friesen
Friesen Computer Company
Willows, CA




 
©2007 Chester Friesen
<-- Prior Message New Search Next Message -->