how to sum several rows by a common column (ie customer)

G

Guest

I've created an access query of which I'm trying to "summarize" by part by
customer. Example of query "raw data" and what I'm attempting to summarize,
below:

"Raw Query Data"
Part # Customer Qty Sold
XYZ John 5
XYZ John 6
XYZ Pete 4


"What I'm attempting to summarize when I run query"
Part # Customer Qty Sold
XYZ John 11
XYZ Pete 4

I would appreciate any help you can offer regarding this matter.

Thanks,
Pete
 
A

Allen Browne

In query design view, depress the Total icon on the toolbar (upper sigma
icon.) Access adds a Total row to the grid.

In the Total row under Part # and Customer, accept Group By.

In the Total row under Qty Sold, choose Sum.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

"Transpose data in rows to columns"
 
J

John Spencer

In the query you have,
--Select View: Totals from the menu
--In the Total row for QTY SOLD, change "Group By" to "Sum"

In the SQL view this would look something like:
SELECT [Part #], Customer, Sum([Qty Sold]) as Total Sold
FROM [Your Table Name]
GROUP BY [Part #], Customer
 

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