title: Simple select fails in Firebird
body: <p>All I want to do is select records between two dates to second precision (between YYYY-MM-DD HH:II:SS and YYYY-MM-DD HH:II:SS). The field which contains date AND time is in TIMESTAMP format. I can't even select records by date.</p>
  
  <p>The query</p>
  
  <pre><code>SELECT *
  FROM INVOICE
  WHERE CAST(INVOICE.WHENINVOICED AS DATE) = CAST('2010-10-15' AS DATE)
  ORDER BY INVOICE.WHENINVOICED ASC
  </code></pre>
  
  <p>returns no records and no error. Records exist with this date.</p>