Skip to content
Prev 86812 / 398502 Next

sqlSave

Hi, 

I am having trouble to write/create a table, which has
a date field. I want to create a stock price table,
which has fields of ticker, date, price. First, I
created such a table in Microsoft Access with a few
rows inputs. Using sqlQuery, I found that the date
field was retrieved as POSIXct value. Then I made a
data.frame with POSIXct as the data type for dates.
However, I received the following errors when I was
executing the sqlSave:
as.POSIXct("2003-1-2"), as.POSIXct("2003-1-3"),
as.POSIXct("2003-1-4"), as.POSIXct("2003-1-5"))
ticker       date price
1  FMDEX 2003-01-01     1
2  FMDEX 2003-01-02     2
3  FMDEX 2003-01-03     3
4  FMDEX 2003-01-04     4
5  FMDEX 2003-01-05     5
Error in sqlSave(h, price, rownames = F) : 
        [RODBC] ERROR: Could not SQLExecDirect
37000 -3553 [Microsoft][ODBC Microsoft Access Driver]
Syntax error in field definition.


I am using R2.2.1 with RODBC library, on a Dell P5
computer with winXP Pro and office 2003. 

Thanks for your helps. 

Sean