Home » SQL & PL/SQL » SQL & PL/SQL » how to calculate total duration of the course hours
how to calculate total duration of the course hours [message #208063] Fri, 08 December 2006 00:26 Go to next message
gi_srinivas
Messages: 19
Registered: September 2005
Location: Hyderan
Junior Member

Hi,

I need to calculate the total duration of the course hours for a particular course.

For Ex: Course_start_time = 09:30
Course_end_time = 15:00
And the Course_days = 3 days
The output should be Course_days * (Difference between the Course_end_time and Course_start_time).
like 3 * 5:30hr =16:30 hrs.

Please can anybody help me on this requirement.

Thanks and regards,
Srinivas G
Re: how to calculate total duration of the course hours [message #208115 is a reply to message #208063] Fri, 08 December 2006 04:24 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
total_days : = Course_days * (to_date(Course_end_time,'HH24:MI') - to_date(Course_start_time,'HH24:MI'));

total_hrs := trunc(24 * total_days);
total_mins:= trunc(3600 * total_days) - 60 * trunc(24 * total_days);

By
Vamsi
Re: how to calculate total duration of the course hours [message #208202 is a reply to message #208115] Fri, 08 December 2006 10:02 Go to previous messageGo to next message
gi_srinivas
Messages: 19
Registered: September 2005
Location: Hyderan
Junior Member

Thanks a lot Vamsi.
I will try this.

Bye
Srinivas
Re: how to calculate total duration of the course hours [message #209465 is a reply to message #208202] Fri, 15 December 2006 00:34 Go to previous message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Better one.
Ross
By
Vamsi
Previous Topic: date difference
Next Topic: Need Help plz
Goto Forum:
  


Current Time: Wed Dec 07 06:58:45 CST 2016

Total time taken to generate the page: 0.06531 seconds