Summing text fields?

D

DashOneCharlie

How do I frame a query that allows me to sum up the dollars spent with a
particular vendor or PO without repeating the field over and over?
 
J

Jerry Whittle

Show us examples of your data including the actual column and table names.
Also show how you want the data be returned by the query.
 
D

DashOneCharlie

Okay, the fields are:

PO Number Vendor Name Item Qty Total


I do an entry for each item purchased, and there are multiple items per
purchase order. I would like the query to total the dollars spent per
purchase order without all the line item details and without repeating the
vendor and PO numbers so that I don't have to do a separate table by PO and
total.
 
J

Jerry Whittle

SELECT [PO Number], Sum([Total])
FROM YourTable
GROUP BY [PO Number]
ORDER BY [PO Number] ;

SELECT [Vendor Name], Sum([Total])
FROM YourTable
GROUP BY [Vendor Name]
ORDER BY [Vendor Name] ;

SELECT [Vendor Name], [PO Number], Sum([Total])
FROM YourTable
GROUP BY [Vendor Name], [PO Number]
ORDER BY [Vendor Name], [PO Number] ;
 
Top