I have a table that has a date/time field and am trying to figure out how to run a report so that I can view the sum of the amount between each month separately in the 2012 year.
The table has 2 fields, Amount and TimeStamp, and I’m trying to return a report like this:
- January, 2012: $221.20
- February, 2012: $150.20
etc etc.
Anyone have any ideas how to accomplish this easily in SQL Server? I want to avoid writing a seperate query for each individual month.
This can be solved by using the MONTH and YEAR Functions on SQL.