title: Select data range when time and date are concatenated
body: <p>I am currently using the line below to get the date</p>
  
  <pre><code>WHERE DATE (DateTime) BETWEEN '2016-12-19' AND '2016-12-23'
  </code></pre>
  
  <p><code>12/12/2016 09:31</code> -  this is the date and time format</p>
  
  <p>But it keeps on returning everything in the table from 2014.</p>
  
  <p>The statement above seems to only work when its a short query but when I add a few lines to the SQL query it doesn't seem to work, Its extracting all dates in the table.</p>
  
  <pre><code>SELECT phone_number,system_outcome,DateTime
  FROM calls 
  WHERE DATE (DateTime) BETWEEN '2016-12-19' AND '2016-12-23'
  AND system_outcome = 'ANSWER_MACHINE'
  GROUP BY phone_number
  HAVING count(Phone_number) &gt; 6
  </code></pre>