On 01/04/2012 12:34 PM, Igor Tandetnik wrote:
John<li...@jspect.fastmail.fm>  wrote:
Can the date time functions in SQLite correctly interpret a date string
like '20120331'?

No. Recognized formats are documented here:

http://sqlite.org/lang_datefunc.html

Is there a format or modifier that will help the function interpret/convert 
that as '2012-03-31'?

Well, you could write something like

select substr(d, 1, 4) || '-' || substr(d, 5, 2) || '-' || substr(d, 7)
from (select '20120331' as d);


Thanks Igor (and Simon)

That is pretty much the path I was thinking of taking (or possibly externally as I import the data), was just wondering if I had missed something in the date functions.

John

--
Regards
   John McMahon
        j...@jspect.fastmail.com.au
        04 2933 4203

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

Reply via email to