I am calculating TotalHours
of a employee worked in office based on Intime
and Outtime
resultant in the form of hh.mm
like 8.30
.
So, I wrote below sql query :
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
The above sql server query was running correctly intially, but now it is giving following exception:
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.
Could anybody please help me to get rid off of this?