title: MySQL query with date ranges returning no results
body: <p>So I am doing this query from PHP, and here listerally the exact query string:</p>
  
  <pre><code>SELECT * FROM `pdem_timesheet`.`tblMasterTimesheets` WHERE 
  `pdem_timesheet`.`tblMasterTimesheets`.`username` = 'pdem' AND 
  `pdem_timesheet`.`tblMasterTimesheets`.`date` &gt;= '2012-05-09' AND 
  `pdem_timesheet`.`tblMasterTimesheets`.`date` &lt;= '2012-05-15' ORDER BY
  `pdem_timesheet`.`tblMasterTimesheets`.`date` ASC 
  </code></pre>
  
  <p>It looks like it should be correct to me (more-or-less copying it from previous code I used that DOES work). But when I run the query, the results are empty.</p>
  
  <p>If I change the query to not be a date range, but just a single day:</p>
  
  <pre><code>SELECT * FROM .... WHERE ...`date` = '2012-06-12' ....
  </code></pre>
  
  <p>it works just fine, returns the one result that it should.</p>
  
  <p>I have tried using the between keyword:</p>
  
  <pre><code>SELECT * FROM ... WHERE ...`date` BETWEEN [start] [end]
  </code></pre>
  
  <p>but it still returns nothing...</p>
  
  <p>Any ideas how to get this query to return a result?</p>
  
  <p><strong>===ANSWER===</strong></p>
  
  <p>When you go: </p>
  
  <pre><code>var curr_date = now.getDate();
  var curr_month = now.getMonth();
  var curr_year = now.getFullYear();
  </code></pre>
  
  <p>it returns the month - 1 for some reason. So if now's month is 6, now.getMonth() will return 5...Just need to add 1 in the query (wish I saw this sooner)</p>