Dates for the whole month

M

mahmad

Hi,

Team Amount Date
------- --------- ------
Blue 100 01/03/2008
Blue 200 02/03/2008
Green 500 01/03/2008
Green 400 02/03/2008

How can i sum the amounts for each team. So everyday the Amount field will
include the amount from the previous date. Basically i want a comulative
figure for the month for each Team.

Thanks for your help
 
C

Conan Kelly

mahmad,

If your Date field/column has a date/time data type, then something like
this might work:

SELECT DateSerial(Year([Date]),Month([Date]),1) as [MonthBeginDate], Team,
Sum([Amount]) as MonthlyAmount
FROM YourTableName
GROUP BY DateSerial(Year([Date]),Month([Date]),1), Team

(I typed this in free hand...did not test...typos are possible)

HTH,

Conan
 

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