Sum & Group By

D

Dave

Hi,

Please help with some SQL. I have a table with vendor_name,Invoice
Date,Invoice Number,Invoice Amount & ID Name. This table has about 300
different Invoice Numbers.

I want to add the Invoice Amount for each of these 300 different
Invoice Numbers & group them by Invoice Numbers .

thanks

newby dave
 
J

John W. Vinson

Hi,

Please help with some SQL. I have a table with vendor_name,Invoice
Date,Invoice Number,Invoice Amount & ID Name. This table has about 300
different Invoice Numbers.

I want to add the Invoice Amount for each of these 300 different
Invoice Numbers & group them by Invoice Numbers .

thanks

newby dave

Just create a Query based on the table. Select the Invoice Number and the
Amount. Change the query to a Totals query by clicking the Greek Sigma button
on the toolbar - it looks like a sideways M. Leave the default Group By on the
invoice number, and change it to Sum on the amount.

The SQL would be

SELECT [Invoice Number], Sum([Invoice Amount]) FROM yourtable GROUP BY
[Invoice Number];

Note that I'm answering the question you *asked* - which might not in fact be
the right question. You mention the vendor name and invoice date but don't
indicate what role they play in this problem. Post back if you need more help!
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

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

Similar Threads

VBA works in orignal but fails in copy of database 1
Append Invoice 22
GROUP BY question 1
Remove a result from a query 4
Access 2003 2
Syntax error in union query 2
vba code for a query 1
Ranking records 1

Top