title: Mysql call does not work, I'm trying to get orders from today
body: <p>Is there anyone here that can tell me why this call to mysql does not work?</p>
  
  <p>I have tried for infinity. I'm trying to get the orders that have been out for today! from 00.00 until now</p>
  
  <pre><code>   $sqltoday = "SELECT COUNT(*) as total FROM wpd2_posts p JOIN              
     wpd2_postmeta pm ON p.ID = pm.post_id WHERE p.post_status = 'wc-completed'
     AND pm.meta_key = '_order_total'
     AND pm.meta_value &lt; 250  AND DATEDIFF(NOW(), p.post_date) &lt;= 0 ";
  </code></pre>
  
  <p>The script runs really well without AND DATEDIFF(NOW(), p.post_date) &lt;= 0, but i need it. </p>