How to compare sqlite TIMESTAMP values

Posted by Roel on Stack Overflow See other posts from Stack Overflow or by Roel
Published on 2010-05-28T16:30:04Z Indexed on 2010/05/28 16:31 UTC
Read the original article Hit count: 428

Filed under:
|
|

I have an Sqlite database in which I want to select rows of which the value in a TIMESTAMP column is before a certain date. I would think this to be simple but I can't get it done. I have tried this:

SELECT * FROM logged_event WHERE logged_event.CREATED_AT < '2010-05-28 16:20:55'

and various variations on it, like with the date functions. I've read http://sqlite.org/lang_datefunc.html and http://www.sqlite.org/datatypes.html and I would expect that the column would be a numeric type, and that the comparison would be done on the unix timestamp value. Apparantly not. Anyone who can help? If it matters, I'm trying this out in Sqlite Expert Personal.

© Stack Overflow or respective owner

Related posts about sql

Related posts about sqlite