[EMAIL PROTECTED] wrote:
Tried it, but get the error invalid use of null.
The field I tried it on had no NULL values.
Will figure it out.

Bart,

I should have tested what I posted first. There is a small problem, the julianday function needs a date string in YYYY-MM-DD format, but the numeric calculations don't insert leading zeros for months and days less than 10. Here i sa modified version that does leading zero insertion. Even more reason to use the original substring based version.

select
   cast (
       julianday(
           cast(20061204 / 10000 as integer) || '-' ||
substr('00' || (cast(20061204 / 100 as integer) % 100), -2, 2) || '-' ||
           substr('00' || (20061204 % 100), -2, 2)
       ) - julianday('1900-01-01')
       as integer
   ) as excel_date
;

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to