Alosyius
Alosyius

Reputation: 9121

SQLite select rows from today and rows older than today?

How can I select all rows that are older than today?

I've tried:

select * from chatHistory WHERE channelID = '%1' AND time >= date('-1 day') order by date(time) ASC;

But this only seems to return rows that are 1 day old.

Upvotes: 0

Views: 833

Answers (1)

CL.
CL.

Reputation: 180050

For timestamps, a > b means that a is later/newer than b.

"Older" is the opposite. You want a comparison like time < date('now').

Upvotes: 1

Related Questions