Reputation: 103
I have a column with datetime entries, and I would like to get all the items from the last 24 hours. Right now I'm trying:
SELECT * FROM " + SQLHelp.LOG_TABLE + " WHERE " + SQLHelp.TIME_COLUMN + "> datetime('now','-1day')
where SQLHelp.LOG_TABLE and SQLHelp.TIME_COLUMN
are the names of the table and column respectively.
Upvotes: 4
Views: 3626
Reputation: 103
There must be a space between -1
and day
; datetime('now','-1 day')
works as expected.
Upvotes: 3