title: How to grab data from the last 13 months?
body: <p>So I have this code, this is for grabbing data for the last 11 month of sale including the current month, make it a whole year. What do I have to do to change it to grabbing data for the last 12 months plus current month? I know I have to change something on the right(select period)... but not sure</p>
  
  <p>In this one, the left function shows how to get the current year (2014 ) minus 1 to give 2013.. but I don't understand the right function, what does 2 mean?
  Thanks</p>
  
  <pre><code>period &lt;= (
      SELECT Period 
      FROM dbo.FiscalDates 
      WHERE (Date = CONVERT(varchar(10), GETDATE(), 102))) and period &gt;= (
  convert(varchar, left((
      SELECT Period 
      FROM dbo.FiscalDates 
      WHERE (Date = CONVERT(varchar(10), GETDATE(), 102))),4)-1)+'-'+
  convert(varchar, right((
      SELECT Period 
      FROM dbo.FiscalDates 
      WHERE (Date = CONVERT(varchar(10), GETDATE(), 102))),2)))
  group by prodnum, period, WhseNum
  </code></pre>