Dates in SAS are numeric. Meaning that they are in fact the number of days (in case of a date value) or seconds (in case of a datetime value) from jan 1 1960. By you description, that the field (SLFDATE) is a numeric field, perhaps that field holds the correct date value but has some kind of display format.
Let us know what you find.
FYI,
If you get the number of days from 1/1/1960 (meaning that your var has the SAS date) all you need to do to get the datetime value is to multiply the date value by 86400 (number of seconds in a day). This will give you a proper SAS datatime value.
Klaz
Thank you for your reply!
My problem is a little bit different.
SLFDATE is a numeric field of an Oracle database. For some reasons developers decided to store Dates as numeric values. I need to transfer data from this Database to a MSSQL Database to a table with DateTime field.
My solution.
I broke down SLFDATE on three parts and insert "/" between them. So 20060731 became 07/31/2006. After that I transfer it to a temporary table as a string. MSSQL Table recognizes strings like that as a date value. After that using predefined View which converts this value to datetime format I transfered data from a temporary table to my final destination table.
It worked, but it's got to be a better way to do it ))
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.