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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting a calculated field in the Header/Footer

Status
Not open for further replies.

aimbc

IS-IT--Management
Apr 18, 2001
47
US
I know this question has been ask several time, but none of them seem to work for me. Here is my situation.

I am grouping on two fields, Item and Customer. In the Customer group footer, I have created a calculation field Purchase to total out the number of purchases made by each Customer. How do I sort it so that I can see the Customer with the most purchase first.

I've tried using orderby in the footer event programming, but it did not seem to help.

Any assistance would be great.

Brian [dazed]
 
Hi, It might work better to create a calculated control in the reports query field that sums your quantities and then use that to order by. The following Sql should help:


SELECT Table1.Cust, Table1.Item, Count(Table1.Item) AS SumItem
FROM Table1
GROUP BY Table1.Cust, Table1.Item
ORDER BY Count(Table1.Item) DESC;

Cust - Customer
Item - Item
SumItem - Counts Items by customer and orders in descending amounts.

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top