Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-01-26 : 13:03:12
|
Dear All,I have one table with this structureLog_Id - Task - Total_Time_Spent(HH:MM:SS)A1-T1-00:15:01 A2-T2-02:09:09A3-T3-01:59:54A1-T1-02:05:25A1-T1-02:08:26Now i have to check log_id wise total time spent.How should i do? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-26 : 13:06:55
|
[code]SELECT Log_Id,SUM(DATEDIFF(ss,0,Total_Time_Spent))FROM tableGROUP BY Log_Id[/code] |
 |
|
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-01-26 : 13:39:57
|
But i want anser to be in HH:MM:SS Format |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-01-26 : 15:41:08
|
SELECT Log_Id,CONVERT(CHAR(8), DATEADD(SECOND, SUM(DATEDIFF(SECOND, 0, Total_Time_Spent)), 0), 8)FROM tableGROUP BY Log_Id N 56°04'39.26"E 12°55'05.63" |
 |
|
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-01-27 : 12:16:14
|
Thanks |
 |
|
|
|
|