Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Help with date calculation

RE: Help with date calculation

From: Djordje Jankovic <djankovic_at_corp.attcanada.ca>
Date: Wed, 15 Nov 2000 23:54:30 -0500
Message-Id: <10681.122218@fatcity.com>


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



Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays! http://calendar.yahoo.com/
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: LOREN SUMMERS
  INET: loren_summers_at_yahoo.com
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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US