Sqldf - Using sql server Inbuilt functions error

51 views
Skip to first unread message

mohamme...@gmail.com

unread,
Mar 22, 2016, 10:49:09 AM3/22/16
to sqldf
I'm trying to run the following query in R:


result <- sqldf("select t.IncidentYear, count(*) as YearlyIncidentCount
from (select fi.*, year(fi.INCIDENT_DATE) as IncidentYear
from [databse_inci].[dbo].[fire_incident] fi) as t
group by t.IncidentYear")

it gives me the following error:

"sqliteSendQuery(con, statement, bind.data): error in statement: no such function: year "

It is not recognizing inbuilt function year(). How do I solve this ?


-Mohammed

Gabor Grothendieck

unread,
Mar 22, 2016, 10:55:03 AM3/22/16
to sqldf
sqldf uses sqlite by default and can also use H2, MySQL and PostgreSQL backends.  SQL Server is not supported.
Reply all
Reply to author
Forward
0 new messages