Remove the " around the s in the datediff function when using T-SQL in SQL Server. You should add a decimal to the 3600 to calculate fractions of hours.
I would also add an alias for the calculated time and count.
SELECT
name,
datediff(s, start_time, stop_time) / 3600. As Hours,
count(name) As Cnt
FROM usertime
GROUP BY name Terry L. Broadbent FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.