Home » SQL & PL/SQL » SQL & PL/SQL » Time Duration Calculation (merged 3)
Time Duration Calculation (merged 3) [message #420517] Mon, 31 August 2009 01:32 Go to next message
sumedh7
Messages: 31
Registered: March 2007
Location: Pune,India
Member
hi,

i want to calculate total time duration, in front end crf_obj.stringval16 is start_date and crf_obj.stringval15 is end date, please advice below whether below statement will give proper output.


v_duration :=TO_NUMBER(TO_CHAR (TO_DATE (crf_obj.stringval16,'dd/mm/rrrr HH24:MI:SS'),'MI'))
- TO_NUMBER (TO_CHAR (TO_DATE (crf_obj.stringval15,'dd/mm/rrrr HH24:MI:SS'),'MI'));
v_duration := v_duration / 60;



Thanx in advance
Re: Time Duration Calculation (merged 3) [message #420525 is a reply to message #420517] Mon, 31 August 2009 02:08 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The difference between is in unit of day.
Mutiply by 1440 if you want in unit of minute.

Regards
Michel
Re: Time Duration Calculation (merged 3) [message #420529 is a reply to message #420517] Mon, 31 August 2009 02:16 Go to previous message
sen_sam86
Messages: 33
Registered: August 2009
Location: Chennai
Member
Try this

 select to_date-fr_date "day", 
       (to_date-fr_date)*24 "hrs",
       (to_date-fr_date)*24*60 "min",
       (to_date-fr_date)*24*60*60 "Tsec"
from tab_name
Previous Topic: search for a column value in all tables of a schema
Next Topic: SQL for check the integrity of 2 database.
Goto Forum:
  


Current Time: Sun Sep 25 12:57:11 CDT 2016

Total time taken to generate the page: 0.06757 seconds