Re: [R] Passing Multiple Variable Into SQLDF Statement as parameters of function

2012-07-12 Thread Gabor Grothendieck
On Thu, Jul 12, 2012 at 9:41 AM, scstrein wrote: > Thanks! For some reason, example 5 in that documentation doesn't work for me. > It runs the query, but I'm getting zero results. If I substitute the > variable with the actual value, I do get the results I want. Is there a > reason for this? Re

Re: [R] Passing Multiple Variable Into SQLDF Statement as parameters of function

2012-07-12 Thread scstrein
Thanks! For some reason, example 5 in that documentation doesn't work for me. It runs the query, but I'm getting zero results. If I substitute the variable with the actual value, I do get the results I want. Is there a reason for this? -- View this message in context: http://r.789695.n4.nabbl

Re: [R] Passing Multiple Variable Into SQLDF Statement as parameters of function

2012-07-11 Thread jim holtman
You have to explicitly add the quotes: Example=paste0("select * from LibDB where Date_Entered ='",as.character(StartDate), "'") # notice the single quotes within the double quotes > sqldf(Example,verbose=TRUE) On Wed, Jul 11, 2012 at 11:16 AM, scstrein wrote: > Hey guys, > > So I'm working with

Re: [R] Passing Multiple Variable Into SQLDF Statement as parameters of function

2012-07-11 Thread Gabor Grothendieck
On Wed, Jul 11, 2012 at 11:16 AM, scstrein wrote: > Hey guys, > > So I'm working with a project where I manage a database within R, and I'm > developing a script/function that will automatically run my queries in R > depending on the date parameters passed in. > > The problem is that when I create

[R] Passing Multiple Variable Into SQLDF Statement as parameters of function

2012-07-11 Thread scstrein
Hey guys, So I'm working with a project where I manage a database within R, and I'm developing a script/function that will automatically run my queries in R depending on the date parameters passed in. The problem is that when I create variables for the dates, and use those variables in my sqldf s