title: SQLQuery to find dates in a specified range
body: <p>Here is my Query for an <strong>SQLite3 DB</strong></p>
  
  <pre><code>SELECT tddate, 
  CASE tdtype 
    WHEN 'LOGIN' THEN MIN(tdtime) 
    WHEN 'SHUTDOWN' THEN MAX(tdtime) 
    ELSE NULL
  END AS tdtime, tdtype, tdusername 
  FROM TimeData
  WHERE tdusername LIKE 'joe.shmoe' 
  AND tddivision = 'divisionA' 
  AND tddate &gt; '6/1/2011' 
  AND tddate &lt; '7/5/2011' 
  GROUP BY tddate, tdtype, tdusername 
  ORDER BY tddate, tdtime DESC
  </code></pre>
  
  <p>results are dates that are from 6/30/2011 to 7/11/2011</p>
  
  <p>I tried another query (much simplier to isolate the problem). I get the same results.</p>
  
  <pre><code>SELECT * 
  FROM TimeData
  WHERE tddate &gt; '6/1/2011' 
  AND tddate &lt; '7/5/2011' 
  ORDER BY tddate DESC
  </code></pre>
  
  <p>Here is the DDL for the table</p>
  
  <pre><code>CREATE TABLE [TimeData] (
    [tdtag] CHAR(8), 
    [tdusername] CHAR(50), 
    [tddivision] CHAR(50), 
    [tddate] CHAR(10), 
    [tdtime] CHAR(8), 
    [tdipaddress] CHAR(14), 
    [tdtype] CHAR(8));
  </code></pre>