Re: [R] sqlQuery with date attribute

2008-08-13 Thread Abderrazzak MANY
Thank you for your answer. Actually, I've tried with this function where I added the # symbol between the date: GetReturn<-function(code,date) { db<-"C:/Test.mdb" channel<-odbcConnectAccess(db) ssql<-paste("select * from tblCalendarDate Where CalendarID =",code,"and DateRebal= #",date,"#")

Re: [R] sqlQuery with date attribute

2008-08-13 Thread Samuel Bächler
Hi Many GetReturn<-function(code,date) { db<-"C:/Test.mdb" channel<-odbcConnectAccess(db) ssql<-paste("select * from tblCalendarDate Where CalendarID =",code,"and DateRebal >=",date) print(ssql)# so as i can see what ssql contains mydata<-sqlQuery(channel,ssql) mydata } [snip] This is th

[R] sqlQuery with date attribute

2008-08-12 Thread Abderrazzak MANY
Hello R users, I would like to use an integer and a date as attributes in sqlQuery, and these arguments are defined in my function. I guess this is clearer comparing to my first post. Here is my function: GetReturn<-function(code,date) { db<-"C:/Test.mdb" channel<-odbcConnectAccess(db) ssql<