0
votes

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?

1
What if you remove that option?vasja
I get the same error.John Chrysostom
What SQL server datatype is TheDate? Is it the FIRST field of Data_DSB_Raw? Is this using ODBC or OLEDB connection?vasja

1 Answers

0
votes

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.