0

I'd like to insert a date field into a SQL server table form Proc SQL in SAS. Here is my code for Proc SQL:

proc sql;
    insert into CFS_SQL.Data_DSB_Raw(sasdatefmt=(TheDate='mmddyy10.'))
    select TheDateIncoming
    from Work.Upload;
quit;

According to the SAS help documentation (http://support.sas.com/kb/6/450.html), this should work as long as TheDateIncoming also has format mmddyy10.. I've verified that the format on TheDateIncoming is correct, so I think this should work.

Unfortunately, however, I'm getting a "Value 1 on the SELECT clause does not match the data type of the corresponding column" error.

Any thoughts?

John Chrysostom
  • 3,973
  • 1
  • 34
  • 50

1 Answers1

0

Annnnnd... solved. It actually had nothing to do with the code. It was a driver problem. Switching to the SQL Server Native Client 11.0 ODBC driver fixed the issue.

John Chrysostom
  • 3,973
  • 1
  • 34
  • 50