title: SQL select date range by month and year
body: <p>How do I select date range from this query?</p>
  
  <p>E.g : From Month('2017-05-22') And Year(date1) = Year('2017-05-22') 
  to Month('2018-05-22') And Year(date1) = Year('2018-05-22')</p>
  
  <p>My current query :</p>
  
  <pre><code>SELECT 
    date1
  FROM 
    data
  WHERE 
    Month(date1) = Month('2018-05-22') And Year(date1) = Year('2018-05-22')
  </code></pre>