[EMAIL PROTECTED] wrote:
I'm wandering if CAST is supposed to work?
Yes.
sqlite> create table tab(col date);
sqlite> insert into tab values('1994-11-11');
sqlite> create table tab2 as select cast(col as DATE) from tab;
sqlite> .schema tab2
CREATE TABLE tab2("cast(col as DATE)");
sqlite> select * from tab2;
1994
SQLite does not have a dedicated DATE type. See
http://sqlite.org/datatype3.html . When given an unknown type, SQlite
assumes numeric. That's why CAST('1994-11-11' as DATE) produces 1994. So
would CAST('1994-11-11' as ANY_RANDOM_STRING).
It is customary to store dates as strings in SQLite. Several functions
are provided to manipulate dates in this representation.
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------