get the total for a column based on an invoice number

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...
 
L

Lynn Trapp

Select CustomerName, InvoiceNumber, Sum(ItemPrice)
From YourTable
Group By CustomerName, InvoiceNumber;
 

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