Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query or report to sum data for a particular month 1

Status
Not open for further replies.
Mar 2, 2005
10
KN
I have a table with many entries of dates within a particular month. I want a query that will sum all of the data for all the months.
QTY_5_NEW QTY_10_NEW QTY_20_NEW DATE
0 0 0 1/1/2006
0 0 3000 1/1/2006
0 0 3000 10/1/2006
0 0 10000 12/1/2006
12000 0 0 2/2/2006
0 1000 5000 21/2/2006
0 10000 0 2/3/2006
0 4000 0 1/4/2006
I want it like this
QTY_5_NEW QTY_10_NEW QTY_20_NEW DATE
0 0 16000 jan 2006
12000 1000 5000 feb 2006
0 10000 3000 mar 2006
 
A starting point:
SELECT Sum(QTY_5_NEW), Sum(QTY_10_NEW, Sum(QTY_20_NEW), Format([DATE], 'mmm yyyy')
FROM yourTable
GROUP BY Format([DATE], 'mmm yyyy')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top