我正在计算TotalHours
一个在办公室工作的员工,基于Intime
并以likeOuttime
的形式产生。hh.mm
8.30
所以,我在下面写了 sql 查询:
SELECT EMPLOYEEID, sum(DateDiff(mi,isnull(In_Time,0),isnull(Out_Time,0))/60) +
sum(round(DateDiff(mi,isnull(In_Time,0),isnull(Out_Time,0))%60,2))/100.0 +
sum(round(DateDiff(ss,isnull(In_Time,0),isnull(Out_Time,0)),2))/10000.0 as
TotalHours from HR_EMPLOYEES
上面的 sql server 查询最初运行正确,但现在出现以下异常:
java.sql.SQLException: The datediff function resulted in an overflow. The number of
dateparts separating two date/time instances is too large. Try to use datediff with a
less precise datepart.
有人可以帮我摆脱这个吗?