title: Postgresql query between date ranges
body: <p>I am trying to query my postgresql db to return results where a date is in certain month and year. In other words I would like all the values for a month-year. </p>
  
  <p>The only way i've been able to do it so far is like this:</p>
  
  <pre><code>SELECT user_id 
  FROM user_logs 
  WHERE login_date BETWEEN '2014-02-01' AND '2014-02-28'
  </code></pre>
  
  <p>Problem with this is that I have to calculate the first date and last date before querying the table. Is there a simpler way to do this?</p>
  
  <p>Thanks </p>