Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Sort by Sum Field?

Status
Not open for further replies.

byrne1

Programmer
Aug 7, 2001
415
US
I want to sort my records by the sum of my customer transactions. How do I do it?

Here's my SQL query so far:

SELECT
CUSTSLS."CustNum", CUSTSLS."TransDateYYYYMMDD", CUSTSLS."StoreNum", CUSTSLS."PriceExtension"
FROM
"CRAFTSMAN"."CUSTSLS" CUSTSLS
WHERE
CUSTSLS."TransDateYYYYMMDD" >= 20050801. AND
CUSTSLS."TransDateYYYYMMDD" <= 20050831.
ORDER BY
CUSTSLS."StoreNum" ASC,
CUSTSLS."CustNum" ASC


My beginning and ending trans dates are parameters and my report only shows a summary of "PriceExtension" for each customer. I want this to be sorted in desc order.

Any ideas???

 
Nevermind. I figured out that I had to use Report -> Top N/Group Sort Expert. That did the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top