January 13th, 2004, 01:43 PM
subtracting 2 hours from date returned
I am trying to write a query that will check
where row_date >= sysdate - 2 hours
what would the syntax look like for this?
do i need to set the date format each time i run the query?
January 13th, 2004, 02:53 PM
where row_date >= sysdate - 2/24
will do the job.
January 13th, 2004, 03:04 PM
BTW, Oracle 9i introduced several new date datatypes. One of them is the INTERVAL DAY TO SECOND datatype. Oracle introduced supporting functions for these new datatypes. Ones of them is the NUMTODSINTERVAL function.
So, in 9i, the following is valid:
WHERE row_date >= SYSDATE - NUMTODSINTERVAL(2, 'HOUR')
January 13th, 2004, 08:24 PM
great...thanks for the reply.