I have problem to find the exact time duration . Like this ---> I have {From time} and {To time} two fields in table in SQL server 2008 database. In this how should i find exact duration of this Time....? ? ?
Table:
--------
From Time To Time Duration
01:05:10 Pm 02:05:10 Pm 01:00:00
Thanks In Advance :)


Iftikar HussainRank #423 · 5.9K reputationPosted Aug 7, 2013, 1:06 AM EDT
Regards,
Iftikar
nishant ranjanRank #4,961 · 317 reputationPosted Aug 6, 2013, 11:42 PM EDT
DateTime startTime =Convert.ToDateTime( "01:05:10 Pm");
DateTime endTime =Convert.ToDateTime( " 02:05:10 Pm");
TimeSpan span = endTime.Subtract(startTime);
Response.Write("Time Difference : " + span);
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 7, 2013, 12:20 AM EDT
Are you looking for in SQL?
Regards,
Iftikar
suren v112 reputationPosted Aug 7, 2013, 12:50 AM EDT
Yes,I'm looking in sql only,.....
suren v112 reputationPosted Aug 7, 2013, 10:25 PM EDT
It's not working dude....
Thanks for your reply :)
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 7, 2013, 10:37 PM EDT
Regards,
Iftikar
suren v112 reputationPosted Aug 9, 2013, 7:30 PM EDT
Hai dude i found solution....Thanks for your code...it really works Good:)