views:

27

answers:

2

Hello all, I have some records like this:

ID       Personel_Code        Time 
---      -------------       ------ 
1         0011                05:50
3         0011                20:12
4         0012                00:50

I want to have the sum of times for each person. in this example I want to have the result like this :

Personel_Code          Time
-------------          -----
 0011                  26:02
 0012                   00:50

Thank you.

+1  A: 

Probably you'd do something like this in SQL Server (just a hint, you have to work on details and conversions)

SELECT Personel_Code, SUM(DATEDIFF(MINUTE, '0:00:00', convert(time, Time, 8))) as totalTime
FROM thisTable
GROUP BY Personel_Code
zarko.susnjar
+1  A: 

Here is some sql time codes. Take a look

SQL Examples

drorhan
It's a really good reference. tnx
LIX