title: SQL - Running Total - Year To Date, Previous Year To Date, and Last Rolling 12 Months
body: <p>Thanks for helping me out with this one!  I apologize in advance for the formatting, but I think it is easy to follow.</p>
  
  <p>Provided is a sample table of data.  I need three separate columns created with query language.  The running total must go consider the ID and the date.</p>
  
  <p>Running 12 Months - I need sum the value of each ID for rolling 12 months.</p>
  
  <p>Current YTD - Sum the value of each ID for the current year of the date of the value.</p>
  
  <p>Previous YTD - Sum the value of each ID for the year immediately prior to the date of the value.</p>
  
  <p>THANK YOU!</p>
  
  <p>CURRENT TABLE       </p>
  
  <pre><code>ID  DATE        VALUE
  S1  01/01/2015  5
  S1  02/01/2015  5
  S1  03/01/2015  5
  S1  04/01/2015  5
  S1  05/01/2015  5
  S1  06/01/2015  5
  S1  07/01/2015  5
  S1  08/01/2015  5
  S1  09/01/2015  5
  S1  10/01/2015  5
  S1  11/01/2015  5
  S1  12/01/2015  5
  S1  01/01/2016  5
  S2  01/01/2015  10
  S2  02/01/2015  10
  S2  03/01/2015  10
  S2  04/01/2015  10
  S2  05/01/2015  10
  S2  06/01/2015  10
  S2  07/01/2015  10
  S2  08/01/2015  10
  S2  09/01/2015  10
  S2  10/01/2015  10
  S2  11/01/2015  10
  S2  12/01/2015  10
  S2  01/01/2016  10
  </code></pre>
  
  <p>DESIRED OUTPUT                  </p>
  
  <pre><code>ID  DATE            VALUE   Running12   CalendarYTD PrevCalendarYTD
  S1  01/01/2015      5       5           5   
  S1  02/01/2015      5       10          10  
  S1  03/01/2015      5       15          15  
  S1  04/01/2015      5       20          20  
  S1  05/01/2015      5       25          25  
  S1  06/01/2015      5       30          30  
  S1  07/01/2015      5       35          35  
  S1  08/01/2015      5       40          40  
  S1  09/01/2015      5       45          45  
  S1  10/01/2015      5       50          50  
  S1  11/01/2015      5       55          55  
  S1  12/01/2015      5       60          60  
  S1  01/01/2016      5       60          5              5
  S2  01/01/2015      10      10          10  
  S2  02/01/2015      10      20          20  
  S2  03/01/2015      10      30          30  
  S2  04/01/2015      10      40          40  
  S2  05/01/2015      10      50          50  
  S2  06/01/2015      10      60          60  
  S2  07/01/2015      10      70          70  
  S2  08/01/2015      10      80          80  
  S2  09/01/2015      10      90          90  
  S2  10/01/2015      10      100         100
  S2  11/01/2015      10      110         110 
  S2  12/01/2015      10      120         10  
  S2  01/01/2016      10      120         10              10
  </code></pre>