We help IT Professionals succeed at work.

How sort report by group total

SteveL13
SteveL13 asked
on
I have a report written that has detail lines which I'm hiding, and that is grouped by customer.  In each group footer I am summing numbers in the detail section.  But now what I want to do is SORT the report results by the summed numbers in the footers in descending order.

How can I do this?

--Steve
Comment
Watch Question

Dale FyeOwner, Dev-Soln LLC
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2010

Commented:
You are going to need to modify the Recordsource for the report so that it contains that "summed" quantity as a field in the recordset.
Owner, Dev-Soln LLC
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2010
Commented:
That might look like:

SELECT Field1, Field2, Field3, Field4, DSUM("SomeField", "SomeTable", "Field1 = " & yourTable.Field1) as SortBy
FROM yourTable

Then, in the report, set the SortOrder based the "SortBy" field, largest to smallest.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.