How would it be possible using T-SQL to find the raw amount of time that has passed between when the job started and when the job ended?

i have used this function

datediff(ss,grn_date,GETDATE()) .

this function gets the jobs done how ever if the diffrence btw the dates is huge like grn_date is in u know 2006-1-1 then i get the error that"Arithmetic overflow error converting int to data type numeric." so now what do i do to get the values.

3 Years
Discussion Span
Last Post by AleMonteiro
Featured Replies
  • DateDiff returns an Int not an BigInt, that's why you get the error. One work arround is to get the minutes and then multiple by 60, to get the seconds, like this: `ABS(CONVERT(BigInt, (DateDiff(minute, grn_date, getDate()))) * 60)` I found the answer in this forum: http://www.sqlservercentral.com/Forums/Topic964359-392-1.aspx And here it's a … Read More

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.