RODBC fails: "invalid character value for cast specification" - Excel 2007

I've heard of this problem before:

Workaround:

  • Use "0" for false,
  • Set Paid up as a text field
  • Change your application logic to use !=0 for True

I'll try and find you the bug ticket # for you to track


For Anyone stumbling on this (5 years later), in R you can use the varTypes argument in sqlSave() like sqlSave(..., varTypes = c(somecolname="datetime", anothercolname= "datetime",...)).


I also experienced the same issue today. I want update a table in R to SQL-serve. It gives me the exactly same error message. Then I changed all the "Date" type fields to "character" type. I updated again, it worked.

It seems that SQL-server cannot recognize "Date" type variable from R properly.

Tags:

R

Rodbc