I need to get the total number of accounts per month but in the next month it should include the previous total. There are 2 column in the table one for AccNO and another for date. We count the totals per month group by month and date.
accNO HO_DATE
---------------------------
TN128757 2013-07-21
TN126822 2013-05-16
TN130058 2013-10-11
TN130375 2013-10-30
TN128396 2013-06-20
TN129800 2013-10-22
TN127399 2013-08-25
so in the end the totals would be
2013/05 = 1
2013/06 = 2
2013/07 = 3
2013/08 = 4
2013/09 = 4
2013/10 = 7
so how would I group by or how would this be included in the where clause. I am using MSSQL 2012
thanks