I have a problem with the SUM statement in SQL Server. When I write this query:
SELECT StudentID, StudentName, SUM(t2.time) as 'TotalTime' FROM WorkNote GROUP BY StudentID, StudentName
I get this error:
The time operator of the time data is not valid for the sum operator.
Is there any other method for SUM or for calculating the total time from records?
In my WorkNote table, the WorkNote type time is Time(7) , and I want to SUM all (total) time for each student.
source share