4 Replies Latest reply: Jun 12, 2015 9:23 AM by Shane Spencer RSS

    Oracle (SQL) Database - selecting / extracting a date (number)

    Shane Spencer

      I've got an Oracle database I'm pulling data from. I run this query to get yesterdays data:


      SQL select  *  from HFM_ERRORLOG where DTIMESTAMP>= 42166.0;


      and get the following:



      42166 is 11/06/2015; if I put '11/06/2015' in to excel and convert the format of the cell to Number then '42166' is the number I get. The number of days since 1900 I understand. I need to modify the above select command to use a variable for "yesterdays date" so I can automate it, instead of hard-coding the number in.


      Anyone know how to do this?