On Fri, Mar 28, 2008 at 11:37:10AM -0700, Scott Baker wrote:

> I think what you want is date math:
> 
> sqlite> SELECT date('now','-14 days');
> 2008-03-14

Yes, I wanted date 2 weeks ago. I made a comparison using PostgreSQL, where
it returns the expected date value, and my guess was, that it should have
been working exactly the same way, as the "official syntax" (above), when
I typed "SELECT date('now') - 14" - if it does any date-math anyway, instead
of reporting error.

> Since '2008-03-28' is a string, and you're trying to subtract from that
> it converts it to a integer. '2008-03-28' converts to 2008 as an integer.

Hmmmm... yes, actually every output of SQLite is a string - but the
conversion - if there's an attempt to convert a value - IMHO could be working
a bit smarter way.
-- 
                                pozdrawiam / regards

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

Reply via email to