On Sep 22, 2009, at 10:33 AM, Barton Torbert wrote:

> I guess there are kinks in how SQLite handles date comparisons.
>

Kinks?  SQLite does not do date comparison.  At all.  SQLite has no  
knowledge of a "DATE" type.

SQLite compares numeric values and/or strings.  If you format your  
dates as ISO8601 strings, then the comparisons  will be correct.  (The  
previousl sentence is a feature of the ISO8601 date format.)  If you  
format your dates as numeric values (julian day numbers or seconds  
since 1970 or whatever other style you want) then the comparisons will  
be correct.

But if you mix and match formats and put some dates in one format and  
other dates in another and then try to compare dates in different  
formats, youll probably get an answer that is different from what you  
seem to be expecting. This is because you are not really comparing  
"dates" - you are comparing strings or floating-point numbers and the  
answer you are getting is correct for strings and/or numbers.

D. Richard Hipp
d...@hwaci.com



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to