6
Hi, I looked all over the internet for that answer and I didn’t find :)
I am importing an MDB (Ms Access db) into R Studio (Windows 7 R v32b) using RODBC but when giving the sqlFetch command I am having an error in 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 that’s the result:
Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
I tried to debug sqlFetch but cannot identify where this error is occurring. Does anyone know how to edit this function to fix this failure?
Thank you!
William, maybe you can upload a sample of the *.mdb file, this would help to reproduce the error and maybe give an alternative as a solution.
– Jean
tries to use the argument
as.is = T
.JE <- sqlFetch(channel, sqtable="Table", colnames = FALSE, rownames = FALSE, as.is = T)
– Daniel Falbel
That’s it! It worked!
– Guilherme Louzada
@Danielfalbel, please post the comment with the solution as an answer.
– Flavio Barros
@Guilhermelouzed if Daniel doesn’t post the solution yourself as an answer and close the question. It may be useful for other users.
– Flavio Barros
@Flaviobarros already put!
– Daniel Falbel