-
Time difference function ?
Hi,
Is there any in built function which will give me The diffence between two specified times ?
For example i want difference between
(Mon Sep 1 00:00:05 2003) and (Mon Sep 1 05:45:04 2003)
-
Yes, there is. Although it is technicaly implemented as a function, it is ususally not considered a true function, but rather an operator. It is called "MINUS" (has nothing in common with MINUS "SET OPERATOR")or "SUBTRACTION" in spoken language, it's simbol is "-". It is used both in NUMBER as well as in DATE arythmetics.
To get the time difference between two dates, simply use it like this:
SELECT :date2 - :date1 FROM dual;
You'll get time difference, expressed in days.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
I frequently use to find the process run time by executing the following query:
select prcsinstance seq,
prcstype, prcsname,
begindttm, enddttm,
runstatus sta,
trunc((enddttm - begindttm)*24) HH,
(trunc((enddttm - begindttm)*24*60) - (trunc((enddttm - begindttm)*24)*60)) MM,
(trunc((enddttm - begindttm)*24*60*60) - (trunc((enddttm - begindttm)*24*60))*60) SS
from tablex;
This may also help you.
Tamil
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|