The problem is similar with this one (R, issue with sqldf: cannot make condition on date) but with different error term:
Suppose I have a table:
OrderDate Sales
2005-02-28 12
2005-02-28 234
...
In the original R DataFrame, the data type of OrderDate is double (after as.Date command)
I want to do something like select * from table where OrderDate='2005-02-28'
but encounter errors:
Error: unexpected numeric constant in "sqldf('select * from table where OrderDate='2005"
I tried some solutions proposed on the listed question and others, but still cannot solve it.
I feel like there's something wrong with the data type of OrderDate but don't know exactly. i.e. when I find the numerical value of the date and feed into my condition, it encounters such an error (x is the accordingly numerical value):
Error in .verify.JDBC.result(r, "Unable to retrieve JDBC result set for ", : Unable to retrieve JDBC result set for select * from table where OrderDate=x order by Qty desc limit 3 (Cannot parse "DATE" constant "x"; SQL statement: select * from table where OrderDate=x order by Qty desc limit 3 [22007-175])