Skip to content

How do i convert int to date without arithmentic overflow

Istudent Rana

Asked Mar 21, 2019, 11:40 AM EDT1 answer
Share
LinkedInX
Select userid, timeenrolled
,CASE WHEN timeenrolled is not NULL THEN Convert(Varchar, dateadd(S, CAST(timeenrolled as int), '1970-01-01'), 101) else '' end as DateEnrolled
from Course
 
I am getting "Arithmetic overflow error converting expression to data type int" exception while converting int to date.
 
I figured out the value which is -2208988800. How do i ignore this value in my above query

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Can you please share me both columns type properly.

    it would be easy to understand your question.
    0