Skip to content
Prev 299807 / 398503 Next

Passing Multiple Variable Into SQLDF Statement as parameters of function

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 statements, R says that there is no such column in the
dataframe (which is true!). My question is: how can I pass multiple date
variables into my sqldf statements? In particular, the sqldf is supposed to
read the date parameter as a character string (its the only way I could get
it to work). 

This is my code so far:
This passes the StartDate in correctly, but in a form where my particular
query won't pick up the date in the database. In reality, I want it to act
as the following:
Eventually, I need to have statements such as:
Thanks in advance for any feedback! :)


--
View this message in context: http://r.789695.n4.nabble.com/Passing-Multiple-Variable-Into-SQLDF-Statement-as-parameters-of-function-tp4636147.html
Sent from the R help mailing list archive at Nabble.com.