Paolo Pisati <p.pis...@...> writes: > > It seems i'm having an hard time with dates in sqlite: > > sqlite> .schema > CREATE TABLE `envelope` (`smtp_id` int(10) NOT NULL, `date` date NOT > NULL, `time` time NOT NULL, `mailq_sndr` int(10) NOT NULL, > `delivery_sndr` int(10) NOT NULL, `customer_sndr` int(10) NOT NULL, > `rpath` varchar(250) NOT NULL, `domain_rcvr` varchar(200) NOT NULL, > `user_rcvr` varchar(250) NOT NULL, `size` int(10) NOT NULL, `res` > int(10) NOT NULL, `msg` varchar(250) NOT NULL, `ip` int(10) NOT NULL, > `vsmtp` varchar(250) NOT NULL, `retries` int(10) NOT NULL); > > sqlite> select date from envelope where date > '2009/01/20' limit 3; > 2009/1/7 > 2009/1/7 > 2009/1/7 > > why? >
It's a string comparison, '2009/' is identical in each case but '1/7' > '01/20' since '1' > '0' See also http://www.sqlite.org/lang_datefunc.html MikeW _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users