murdoch at stats.uwo.ca
Thu Jan 25 00:08:16 CET 2007
On 1/24/2007 3:25 PM, jgaseff wrote:
> I am fairly new to R and its connectivity to MS-Access. I just installed
> RODBC and it seems to be working well except when I use the date to
> condition the query. For example the query below
> sqlQuery(channel, "select date from tblUScpi where (date > d2) order by
> returns the following error
>  "[RODBC] ERROR: Could not SQLExecDirect"
>  "07001 -3010 [Microsoft][ODBC Microsoft Access Driver] Too few
> parameters. Expected 1."
> I checked that d2 and the elements in date belong to the same class
> ("POSIXt" "POSIXct"). Can anybody help me?
If d2 is an R variable, you'll need to convert it to SQL syntax for
dates (whatever that is, format() can probably do it). R just passes
the query string to the database, it doesn't do any variable
substitutions for you.
More information about the R-help