I have date values in my SQL Server database and am accessing them through ACCESS ODBC. Accessing them works fine but the dates come back as character values which I can't use. How do I get them into a format where I can use them for date math and date functions in a DATA or other PROC step?
PROC SQL;
CREATE TABLE mikey
SELECT NAME,DOB,Enrolled from SQLServer.EnrollmentTable;
I do a libdef to point the SQLServer library to my sqlserver database. It all works fine and the data comes back. The problem is that the DOB (date of birth) and enrolled (date of enrollment) come back as strings of format yyy-mm-dd 00:00:00
I do get data back but then can't work with these two variables as dates. The format seemed to be YMDDTTM24. but it doesn't find it. I am using SAS/PC 9.2.
I have tried several things, including the following, but nothing works...... Do you ever get dates from DB2 or SQL or Orable? I am using ACCESS for ODBC.
SELECT NAME,INPUT(DOB,date9.) as DOB,Enrolled from SQLServer.EnrollmentTable;
SELECT NAME,DOB INFORMAT=YMDDTTM24. ,Enrolled from SQLServer.EnrollmentTable;
Help! How can I use these dates?