Rich Shepard <[email protected]> wrote:
> On Thu, 8 Oct 2009, Pavel Ivanov wrote:
>
>> And the main problem: SQLite doesn't have such type as date. All
>> types it supports are listed here:
>> http://www.sqlite.org/datatype3.html.
>
>   We can use DATE, TIME, and DATETIME column types; they all have TEXT
> storage class.

Actually, columns with these declared types will have NUMERIC affinity. Storage 
class is a property of each individual value, not of 
a column as a whole: values in different rows of the same column may have 
different storage classes.

>> Bottom line: change the way you store your dates if you really want
>> to compare them in sql statements.
>
>   A closer look tells me that the string format is incorrect for SQL.
> It needs to be YYYY-MM-DD rather than D/M/YYYY. That incorrect format
> seems to be the problem.

Realize that YYYY-MM-DD format works not because SQLite treats it somehow 
specially, but because for strings in this format, 
alphabetical order just happens to match calendar order or dates. But yes, if 
you store your dates as YYYY-MM-DD strings, most 
comparisons will just work.

Igor Tandetnik 


_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to