title: Handling month and sum in SQL Server 2008
body: <p>I have a table with 3 columns: <code>ID, AmountCollected, Date</code>. I need to build a stored procedure that returns me data like this.</p>
  
  <pre><code>Month--CollectionSum
  Jan2011|500
  Feb2011|549
  Mar2011|678
  ............
  </code></pre>
  
  <p>Jan 2011's Collection Sum should be the Sum of <code>AmountCollected</code> with dates of Jan2011 or before, Similarly Feb2011's Collection Sum should be the Sum of <code>AmountCollected</code> with dates of Feb2011 or before and so on....</p>
  
  <p>Can you help me out on this? I need to build the query on SQL Server 2008.</p>