moe
moe

Reputation: 5249

How to Convert Date values in SAS into Regular Dates Using SSIS

I was pulling some data from SAS server and i have encountered some issues with the way SAS stores their date values, it is like numerical values. I am getting some wrong date value when i finish importing the data from SAS into SQL server. SAS date values is a value that represents the number of days between January 1, 1960, and a specified date. so all what i want is to convert the SAS date value into mm/dd/yyyy format. I am using SSIS package to pull the data. Here is an example of how SAS stores their date values. thanks enter image description here

Upvotes: 1

Views: 1220

Answers (1)

DomPazz
DomPazz

Reputation: 12465

I have never used SSIS, but in TSQL I know you can do select DATEADD(day,N,'19600101'). N is the number held by SAS.

select DATEADD(day,35,'19600101')

Returns:

1960-02-05 00:00:00.000

Upvotes: 2

Related Questions