So, it is not a bug but an unadvertised feature. :-) What will happen most likely? That working with decimals for years will also be added in the future, or that working with decimals for months and days will be removed?
Rick van der Lans -----Oorspronkelijk bericht----- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Verzonden: woensdag 31 januari 2007 17:04 Aan: sqlite-users@sqlite.org Onderwerp: Re: [sqlite] adding years,months, days with decimals using datetime function "info" <[EMAIL PROTECTED]> wrote: > Hi, > > If I use the expression datetime('2000-01-01','1.5 months'), SQLite returns > 2000-02-16 00:00:00. This means that it added one month plus half a month. > Makes sense. > > If I use the expression datetime('2000-01-01','1.5 days'), I get 2000-01-02 > 12:00:00. Again this makes sense: 1.5 days is equal to 1 day plus 12 hours. > > But with the expression datetime('2000-01-01','1.5 years') the result is > 2001-01-01 00:00:00. Which means, SQLite added only 1 year and not an extra > 6 months. > > Can anyone explain why using decimals works for months and days and not for > years? > Because nobody has ever written the code to do that. :-) -- D. Richard Hipp <[EMAIL PROTECTED]> ---------------------------------------------------------------------------- - To unsubscribe, send email to [EMAIL PROTECTED] ---------------------------------------------------------------------------- - ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------