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

Access Question

Status
Not open for further replies.

angels1

IS-IT--Management
May 17, 2003
68
US
I want to total a column in a query and show the total in another column called total any suggestions
 
If you are using the query wizard, then just insert the column you want to total along with the data you want to group by, and then click the Totals icon (kind of looks like a backwards 3). That will add a Totals row to your field columns. It has a drop-down box where you can choose group by (default) count, sum, etc. for each field. Choose Sum for the one you want to total, and leave the others as group-by. (You may have to experiment on your field selection and group-by options.)

If you are using SQL, then here is a simple example:

SELECT tblOpenInvoices.supnum, Sum(tblOpenInvoices.InvAmt) AS SumOfInvAmt
FROM tblOpenInvoices
GROUP BY tblOpenInvoices.supnum;

Note: you can change the name of the summed field by inserting the name after AS

I hope this helps.

Danhauer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top