I need to filter data by date using sqldf package.
My table, "episodes" has a field "created_at, which class is POSIXct.
episodes<-data.frame(created_at=seq(from = as.POSIXct('2016-10-01 01:00:00',tz="GMT"), length.out = 100, by = "days") )
> class(episodes$created_at)
[1] "POSIXct" "POSIXt"
I get the 2nd date with:
fechaMin=min(episodes$created_at)
library(lubridate)
fechaSig=fechaMin+hours(24)
And then I filter the data with:
sqldf("SELECT * from episodes e
where strftime('%Y/%m/%d', e.created_at, 'unixepoch')>='$fechaSig' ")
But I get all the data. The filter doesn't work.
I also tried with no success:
sqldf("SELECT * from episodes e
where date(e.created_at, 'unixepoch', 'localtime')>='$fechaSig' ")