Avatar of elucero

asked on 

Converting sas date into SQL server

I'm trying to convert the following dates into sql from sas, both are coming up incorrect.  Any suggestions?

CASE WHEN date_of_birth <0 THEN DATEADD(ss,21914,CAST(ABS(date_of_birth) AS DATETIME))
ELSE DATEADD(ss,1893369600,CAST([date_of_birth] AS DATETIME) ) END as BirthDate
date_of_birth in('-58438','2647911')

date_of_birth   result
-58438             2059-12-31 06:05:14.000
2647911          9209-09-25 00:00:00.000

Microsoft SQL ServerSQL* sasl

Avatar of undefined
Last Comment

8/22/2022 - Mon