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

Home -> Community -> Usenet -> c.d.o.tools -> calculating the difference of time with to_date

calculating the difference of time with to_date

From: <psilvao_at_yahoo.com>
Date: Thu, 21 Dec 2000 15:26:35 GMT
Message-ID: <91t7f2$88p$1@nnrp1.deja.com>

Hi!

     I have problems with this calculate, because the correct calculus between

   12:03am
   11:52pm
- --------

   0:11 and not 23:49

what's the wrong??

[[[_Scrumble_Warrior_]]] #icq_Amigos 11:10pm 10:58pm 0:12
[[[_Scrumble_Warrior_]]] #amigos 11:10pm 10:58pm 0:12
[[[_Scrumble_Warrior_]]] #icq_Amigos 12:03am 11:52pm 23:49
[[[_Scrumble_Warrior_]]] #amigos 12:03am 11:35pm 23:31

select nick,canal,fin,inicio,abs(trunc(24*(to_date(fin,'HH12:MIam')- to_date(inicio,'HH12:MIam')),0))

       || ':'
       || abs(trunc(60*(24*(to_date(fin,'HH12:MIam')-to_date
(inicio,'HH12:MIam'))-trunc(24*(to_date(fin,'HH12:MIam')-to_date (inicio,'HH12:MIam')),0)),0)) as "Delta T" from chateros
where nick like '[[[_Scrumble_Warrior_]]]'

Sent via Deja.com
http://www.deja.com/ Received on Thu Dec 21 2000 - 09:26:35 CST

Original text of this message

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