get the total for a column based on an invoice number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that collects the information from a database for the item
sales for a customer during a particular period.

i would like the query to add the item prices and give me a total for each
invoice.

for example
ID Customer Name Invoice Number Item Number Item Price
1. Customer A 001 001 10
2. Customer A 001 015 13
3. Customer A 001 021 14
4. Customer B 014 031 5
5. Customer B 014 035 25
6. Customer B 014 001 10

I want the output to be

Customer Name Invoice Number Total
Customer A 001 37.00
Customer B 014 40.00

Thank you...
 
Select CustomerName, InvoiceNumber, Sum(ItemPrice)
From YourTable
Group By CustomerName, InvoiceNumber;
 
Back
Top