Miklos, have you tried something like 

SELECT * FROM ticket
WHERE time 
BETWEEN '2011-08-01' AND '2011-09-01';

?

I have my "time" as current_timestamp and gives me data like "2011-09-23 
17:44:48", so using the above method works just fine with me.




>________________________________
>From: Miklos Koren <miklos.ko...@gmail.com>
>To: sqlite-users@sqlite.org
>Sent: Friday, September 16, 2011 3:01 PM
>Subject: [sqlite] select where date < 30 days ago
>
>Hi,
>
>This is probably a basic SQL question, but I could not make it work under
>sqlite. How do I select records for which a datetime column is less than
>today - 30 days? I tried
>
>SELECT * FROM ticket WHERE time < DATETIME('now','-30 days');
>
>but it does not give the intended results.
>
>Thanks,
>
>Miklos
>_______________________________________________
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to