I faced the same problem recently (before I joined this newsgroup). I backed off from SQL to C++ level, which was very uncomfortable. It would be very handy if you implement the same decimal-point parsing for years too ;)
Best Regards, Ivailo Karamanolev On Wednesday, January 31, 2007, 6:04:14 PM, [EMAIL PROTECTED]<sqlite-users@sqlite.org> wrote: > "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] -----------------------------------------------------------------------------