I have this query which works in SQL server:
Convert(datetime, [ChangedDate]) >= DATEADD(DAY, -3, CAST(GETDATE() AS DATE))
I want to make it work in Android SQLite database.
As far as I understood I need to use something like: date('now','+14 day') instead of DATEADD, but it gives me an error on datetime (it could be here Convert(datetime,…) in sqlite.
Can you modify this query in order to make it works on SQLite?
SQLite does not have a
datedata type. So you’re not required to useconvertorcast. A query like this would work:Example at SQL Fiddle.
For more details, see the SQLite manual: