How do I sort by calculated field

P

PAR

relationship = one buyer to many purchases. Report is summary of buyer
purchases. Number of purchases and total purchased. The number of purchases
is calculated "=Count([Lot Info]![Lot No])" , the total purchase is
calculated "=Sum([Price])"

How can I make the report sort by descending total purchases? By descending
total lots?

To get the information to report one total line sorting and grouping is set
to group by buyer number, group ascending. group on each value, interval =1,
keep together = whole group.
 
A

Allen Browne

Presumably the sum of price is in a group footer, so Access calculates it as
it goes. If so, you cannot sort by this expression, since it doens't have
all the value until it has finished laying out the report, which is too
late.

To sort by a total, you need to get that total into the report's Record
Source. One way to do that is to use a Totals query, i.e. depress the Total
button in query design. This feeds the total to the report, so you can sort
by the total, but you don't get the detail records that way. Perhaps you
could use a subreport to show all the details for each total.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top