title: mysql select curdate
body: <p>I have a table like this:</p>
  
  <pre><code>SELECT * 
  FROM  `table_name` 
  ORDER BY  `table_name`.`dtn` DESC 
  LIMIT 0 , 30
  
  id      dt         dtn 
  23  2012-01-20  2012-04-20
  22  2011-12-19  2012-01-19
  </code></pre>
  
  <p>I need to check, which users do I need to visit this month. 
  Example: This user visited on d/m/y 19/12/2011 and sheduled for next visit 19/01/2012.
  Last visit was on 20/01/2012 and next one sheduled for 19/04/2012.</p>
  
  <p>The problem: month is now JANUARY = 1 and I want to show all users that I need to visit this month.
  When I use SQL select statement like this:</p>
  
  <pre><code>SELECT *
  FROM table_name
  WHERE MONTH(dtn) = MONTH(CURDATE()) AND YEAR(dtn) = YEAR(CURDATE())
  </code></pre>
  
  <p>user is listed because in the past were scheduled for january.</p>
  
  <p>In January, this user should not be listed because last scheduled date is 2012-04-20.</p>