Add Time Duration into to Total Duration

Posted by Gopal_nivas under C# on 7/8/2011 | Points: 10 | Views : 1810 | Status : [Member] | Replies : 2
hi..

i was stored time details into database table mentioned below
Id duration

1 0 hrs, 0 min, 7 sec
2 0 hrs, 0 min, 26 sec
1 0 hrs, 1 min, 37 sec
1 0 hrs, 0 min, 39 sec


here i want to calculate the total time based on "ID".

What is the efficient way to do this.

need ur suggestions with examples
Regards
gopal.s




Responses

Posted by: Jpchoudhari on: 7/11/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

use this http://sqlserverbuddy.blogspot.com/2011/06/hour-minute-second-between-two-date.html

u need some modifications; instead of passing start and end time u calculate and send total seconds to this function.

Thanks and Regards,
Jaydeep Choudhari

Kind Regards,
Jay

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: RaviRanjanKr on: 7/11/2011 [Member] Starter | Points: 25

Up
0
Down
The given link have same question with a nice solution proposing some effective store procedure and algorithm which might help you.
http://stackoverflow.com/questions/2013475/calculating-total-time-that-falls-outside-of-dataset-within-date-time-range

Thanks
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response