title: Oracle - selected records between two dates (inclusive) when converting from date string
body: <p>I have the following Oracle query</p>
  
  <pre><code>SELECT *
  FROM table 
  WHERE date_opened 
  BETWEEN ((TO_DATE('2011-08-01', 'yyyy-mm-dd') - to_date('01-JAN-1970','DD-MON-YYYY')) * (86400)) 
  AND ((TO_DATE('2011-08-31', 'yyyy-mm-dd') - to_date('01-JAN-1970','DD-MON-YYYY')) * (86400))
  </code></pre>
  
  <p>that nearly works but it doesn't include the dates records that are dated 2011-08-31.  Any ideas?  It has probably got something to do with how I am converting my date strings...</p>
  
  <p><em><strong>UPDATE</em></strong>: I really should have said that the date is actually a UNIX timestamp.  That is why I am using the 86400 and 01-JAN-1970</p>
  
  <p>Thank you :)</p>