Given this table, I need to generate a year-to-date summary by month. The result should have one row for each month of the year, and a running total for the year up to that month. I am by no means a novice when it comes to SQL, yet I still have no idea how to achieve this in pure SQL. Does anyone know how to do this? Please note that it needs to be compatible with Microsoft Access SQL.
projectTitle | completionDate | amount
---------------------------------------
'Project #1' | 2013-01-12 | 1234
'Project #2' | 2013-01-25 | 4567
'Project #3' | 2013-02-08 | 8901
'Project #4' | 2013-02-15 | 2345
'Project #5' | 2013-02-20 | 6789
'Project #6' | 2013-03-01 | 1234
'Project #7' | 2013-04-12 | 5678
'Project #8' | 2013-05-06 | 9012
'Project #9' | 2013-05-20 | 3456
'Project #10' | 2013-06-18 | 7890
'Project #11' | 2013-08-10 | 1234
Example of the expected results
month | amount
-----------------
'Jan-13' | 5801 -- = Project #1 + Project #2 + Project #3
'Feb-13' | 23836 -- = Project #1 + Project #2 + Project #3 + Project #4 + Project #5
'Mar-13' | 25070 -- ...and so on
'Apr-13' | 30748
'May-13' | 43216
'Jun-13' | 51106
'Jul-13' | 51106
'Aug-13' | 52340
In my example output, you may notice I included July even though the example table did not have any data for July. Ideally, the output would still include July as you see in the example output, however I can live without if necessary.