I am developing a Rails application and using SQLite3 as my database server. I am having an issue querying conferences
that have a to
date_time
that is less than Time.now
. Here is the exact statement in my controller:
@conferences = @conferences.where("to < ?", Time.now)
Where @conferences
is defined beforehand in my controller as
@conferences = @conferences.where("to < ?", Time.now)
I get the following error message:
SQLite3::SQLException: near "to": syntax error: SELECT "conferences".* FROM "conferences" WHERE "conferences"."country_id" = ? AND (to < '2019-08-16 22:45:57.891117') LIMIT ? OFFSET ?
I have tried setting up and reading more about LIMIT
and OFFSET
, but that didn't work probably because I don'thave a good understanding of what they do.