I have records in database:
record B with property `Checked` set to be current date in UTC.
record A with property `Checked` set to be current date in UTC - 48 hours.
Then I want to create query to delete rows with property Checked
older than 24 hours.
In my case only A
should be deleted. Checked
is stored as bigint
in database.
db.Execute("DELETE FROM User WHERE Checked <= strftime('%s', datetime('now', '-1 day'))"); // A and B are not deleted
db.Execute("DELETE FROM User WHERE Checked <= datetime('now', '-1 day')"); // A and B are deleted
db.Execute("DELETE FROM User WHERE Date(checked) <= datetime('now', '-1 day')"); // A and B are not deleted
db.Execute("DELETE FROM User WHERE datetime(checked) <= datetime('now', '-1 day')"); // A and B are not deleted
Do you have any ideas what can be wrong there?
I finally found a solution: