title: Select rolling date range from year/month instead of date field
body: <p>I need to select the last 12 months of rolling demand from a table that contains the following fields:</p>
  
  <pre><code>Item,
  Year,
  Month,
  Demand Qty
  </code></pre>
  
  <p>I have tried the following:</p>
  
  <pre><code>Select Item, [Year], [Month],[Demand QTY]
  FROM [table1]
  Where   
  (
      [Year] &gt;= Year(getdate())-'1'
  and [Month] &gt;= Month(getdate())
  )
  and
  (
      [Year] &lt; year(getdate())+'1'
  and [Month] &lt;= month(getdate())
  )
  </code></pre>
  
  <p>but I am only getting the records for last year and this year of the current month.</p>
  
  <pre><code>Item    Year    Month   Demand Qty
  CD051   2011    3       8800
  CD051   2012    3       0
  </code></pre>
  
  <p>I'm still a rookie so I could be making obvious mistakes. Could someone please help me?</p>