Time difference function ?
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.
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,
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
This may also help you.
Click Here to Expand Forum to Full Width