Reputation: 21
I have a query in MySQL that i want to convert in SQLite. This is my Query:
SELECT * FROM timelogs where `time` >= now() - INTERVAL 1 day
I'd like to get the time entries for the past 24 hours. Anyone who can help me with this?
Upvotes: 0
Views: 22
Reputation: 522171
Try this query:
SELECT *
FROM timelogs
WHERE time >= datetime('now', '-1 day')
datetime('now')
will return the current date time in YYYY-MM-DD HH:MM:SS
format, and then we can offset this by one day.
Upvotes: 1