I think if your dates are in the ISO8601 format, that is yyyy-mm-dd
then this will do it:
SELECT strftime('%Y', '2006-12-26')
More fully explainede here:
http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions
RBS
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 26 December 2006 17:12
To: [email protected]
Subject: [sqlite] date - SQL extraction from day, month and year
Hey,
I have a database with a field where dates are stored! As everybody knows
SQLite has no special date support such as a special datatype for date or
something else. Now I want to select only those records, where the year ist
e.g. 2005. How can I do this?
"SELECT * FROM database WHERE (EXTRACT DAY FROM date) = 2005" does not work.
The database was created with SQLite Analyzer 3.0.8. The datatyp of the
field date ist Text.
Thanks
Karsten
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------