How do you Add up all the records in a query?

daclown81

New member
Local time
Today, 22:27
Joined
Jan 2, 2002
Messages
7
I've made a query and I've got a field called AMOUNT that gives several dollar amounts for the records I've looked up in the query. Now how can I add all those Amounts up (those from the query) and get Sum that equals the Total Amount for the records I have in the query?

I'm trying to put a total amount on a report, but I can't figure out how to make access calculate the Sum of those fields.
 
Use the query wizard and select 'Simple Query' When you go through the wizard select the 'Summary' option. Click on the 'Summary' tab and select Sum for the Amount field.
 
Or do the calculation in the report footer.
=Sum([AMOUNT])
 
Queries do not produce both summary and detail rows. The only way to achieve this is to create two queries, one to produce detail and a second to produce a summary row. Then create a union query to merge the two separate recordsets into one.

If you want the report to print the detail and then summarize it at various break points, do the summary calculations in the report. In the group and report footers add controls that use the sum() function:

=Sum(someField)

This calculation placed in a customer group footer would show the total for a customer and placed in the report footer would show the total for all customers.
 

Users who are viewing this thread

Back
Top Bottom