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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Date and Time arithmetic

Re: Date and Time arithmetic

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 12 Mar 2003 10:59:01 GMT
Message-ID: <b4n3tl$1ubffc$1@ID-82536.news.dfncis.de>

> Hi,
>
> is there any way in oracle to get the number of seconds, minutes, and hours
> between 2 date columns, e.g 11.03.2003 10:00:00 and 09.03.2003 08:15:20?

Something like that?

alter session set nls_date_format = 'dd.mm.yyyy hh24:mi:ss';

select
  trunc(to_date('11.03.2003 10:00:00') -

     to_date('09.03.2003 08:15:20')) "Days",   to_char(to_date('01.01.0001 00:00:00') +     (to_date('11.03.2003 10:00:00') -
     to_date('09.03.2003 08:15:20')),' hh24 mi ss') "Hrs Min Sec" from
  dual;

hth
Rene Nyffenegger

-- 
  Projektleitung und Entwicklung in Oracle/C++/C# Projekten
  http://www.adp-gmbh.ch/cv.html
Received on Wed Mar 12 2003 - 04:59:01 CST

Original text of this message

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