Emmanuel wrote:
I have normal date fields (stored as an integer, and easily manipulated with
date(), strftime(), etc.)
I have one extra field that contains a date but is stored as a DD/MM/YYYY string.
I would like to calculate the number of days between the two. This would be an
easy juliandate() substraction if both dates were of the same data type, but
they aren't.
I am looking for a function similar to Oracle's TO_DATE(string,'DD/MM/YYYY')
which would convert my string into a numerical value representing that date.
This would then allow me to use normal date functions to work on it.
I have tried TO_DATE in SQLite but it didn't work. Is there an equivalent
function? If not, is there any other way to achieve what I'm trying to do?
Emmanuel,
Check out the functions on this page
http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions
In particular the function julianday(datestring) will return a julian
day number for a suitably formatted date string. The supported date
formats are from ISO-8601, or YYYY-MM-DD, so you will have to use substr
and concatenation (||) to rearrange your dates.
HTH
Dennis Cote
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------