how to calculate the actual time? [message #85880] |
Sun, 08 August 2004 18:31 |
Dhalan
Messages: 15 Registered: August 2004
|
Junior Member |
|
|
can anyone help me on how to calculate the time
for example i want to add 10:50:00 with 11:15:45.
not only add, i also want to know on how to substract the time taken.
i used manual method, like convert the time taken to number and the convert it again to char.
i take the time from sys.dual
|
|
|
Re: how to calculate the actual time? [message #85899 is a reply to message #85880] |
Tue, 10 August 2004 02:09 |
Himanshu
Messages: 457 Registered: December 2001
|
Senior Member |
|
|
Hi,
Try following Query:
Select floor((date1-date2)*24*60*60)/3600)||'HOURS'||floor((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600)/60)||'MINUTES'||round((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600 -(floor((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600)/60)*60)))||'SECS' timediff from DUAL;
Regards
Himanshu
|
|
|
Re: how to calculate the actual time? [message #85900 is a reply to message #85880] |
Tue, 10 August 2004 03:20 |
Himanshu
Messages: 457 Registered: December 2001
|
Senior Member |
|
|
Hi,
Try this out:
Select floor((date1-date2)*24*60*60)/3600)||'HOURS'||floor((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600)/60)||'MINUTES'||round((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600 -(floor((((date1-date2)*24*60*60) -
floor(((date1-date2)*24*60*60)/3600)*3600)/60)*60)))||'SECS' timediff from dual;
HTH
Regards
Himanshu
|
|
|