title: Selecting records between two dates
body: <p>I have the following query:</p>
  
  <pre><code>SELECT dm.app_id, apt.app_name, COUNT(dm.app_id) 
  FROM dm_openapp dm
  JOIN app_table apt ON dm.app_id = apt.app_id
  GROUP BY dm.app_id 
  </code></pre>
  
  <p>Basically this table also has dates associated to each record, and I need to get a range of all the records between time X and Y, I tried using the following, for example, but to no avail:</p>
  
  <pre><code>WHERE dm.dl_time BETWEEN '2011-05-31' AND '2011-05-06'
  </code></pre>
  
  <p>Any idea as to what to do? the dl_time column is a timestamp type.</p>