Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Help with date calculation
As long as both adate and bdate are relative to the same date the first
query:
Select *
from timetable
where (adate-bdate) > 20 * 60;
is OK.
Djordje
-----Original Message-----
From: LOREN SUMMERS
To: Multiple recipients of list ORACLE-L
Sent: 11/15/00 9:25 PM
Subject: 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)>2
0);
TIA Loren
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Nov 15 2000 - 22:54:30 CST