SQL Error DateTime Calculations
Posted on 2011-05-05
I have a piece of query that looks like this:
TotalHours_Worked = CAST(datediff(minute, Min(ClockTime), DefaultStart) / 60.0 as decimal(4,2)),
where ClockTime is a time that a user logged in in the morning, and defaultStart is the time that work actually starts. This query is created to find out how long the person worked before work actually starts.
I am getting the following error:
"Arithmetic overflow error converting numeric to data type numeric."
What am I doing wrong?