Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Help with date calculation
I am trying to get this sql statement working.
All the dates are stored in number field in seconds
starting from 1-JAN-1970.
-- All records where adate - bdate is greater than 20
minutes.
Select * from timetable
where (adate - bdatae) > 20 minutes;
-- All records where sydate - bdate > 20 minutes
select * from timetable
where (sydate - bdate) > 20 minutes;
I tried the following and I am not sure whether I am right.
Select * from timetable
where ((adate-bdate) > 20 * 60); --( which will give
20 minutes)
select * from timetable
where
(sysdate-20/1440)-to_date('01-JAN-1970','DD-MON-YYYY')+bdate(24*60*60)>20);
TIA Loren