Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Sum per Month

Author  Topic 

Scott
Posting Yak Master

145 Posts

Posted - 2000-12-20 : 14:34:57
I have a table with a date and money field.
I need a query that will sum the money field by month to generate a report that has monthly totals.
I don't want to have to hardcode select ... where month = ... It must pick up which months have values and return those totals for each month.
eg:
1 Jan 00 $100
10 Jan 00 $200
5 March 00 $300

Must return: Jan 00 = $300, Feb 00 = 0, March 00 = $300

Can anyone please help?
Thanks


   

- Advertisement -