Error as.POSIXlt.character when importing MDB in R

5

Hello, I looked for this answer all over the internet and I did not find:)

I am importing an MDB (Ms Access db) into R Studio (Windows 7 R v32b) using RODBC but when I give the sqlFetch command I am having an error importing a date column that is in dd / mm / YYYY ( Brazilian date format).

This is the code I'm running:

install.packages('RODBC',repos='http://cran.r-project.org')
library(RODBC)
channel <- odbcConnectAccess("db.mdb")
JE <- sqlFetch(channel, sqtable="Table", colnames = FALSE, rownames = FALSE)

And this is the result:

Error in as.POSIXlt.character(x, tz, ...) : 
  character string is not in a standard unambiguous format

I tried to debug sqlFetch but I can not identify where this error is occurring. Does anyone know how to edit this function to fix this fault?

Thank you!

    
asked by anonymous 18.05.2016 / 00:36

1 answer

3

Try to use the as.is = T argument.

JE <- sqlFetch(channel, sqtable="Table", colnames = FALSE, rownames = FALSE, as.is = T)

Then you can convert to date using as.Date .

    
29.07.2016 / 22:29