Istudent Rana

Istudent Rana

  • 1.3k
  • 321
  • 79.9k

how do i convert int to date without arithmentic overflow

Mar 21 2019 3:40 PM
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

Answers (1)