title: MYSQL select records older than 1 day
body: <p>I am trying to select records that are older than 1 day or 24 hours from a MYSQL DB. I can't figure it out why this statement doesn't work with <code>NOW()</code> and it only works if I explicitly add the date manually, here is the code for your review: </p>
  
  <p><code>date_posted</code> is setup as "datetime" in the DB table.</p>
  
  <p>Works this way (Not desirable, for testing only)</p>
  
  <pre><code>SELECT count( DISTINCT my_id ) AS 'a'
  FROM my_table
  WHERE date_posted &gt;= DATE_SUB( '2015-10-03 09:10:19', INTERVAL 24 HOUR )  
  </code></pre>
  
  <p>It should work this way, but it brings a "0" count result:</p>
  
  <pre><code>SELECT count( DISTINCT my_id ) AS 'a'
  FROM my_table
  WHERE date_posted &gt;= DATE_SUB( NOW(), INTERVAL 24 HOUR ) 
  </code></pre>