Running SQLite version 3.7.13 2012-06-11 02:05:22.

A table has a date field with entries in this range: 2012-10-25
through 2012-12-27.

2735080|2012-12-27
2735081|2012-12-27
2735083|2012-12-27
2735084|2012-12-27
2735085|2012-12-27
2735086|2012-12-27
2735087|2012-12-27
2735088|2012-12-27
2735089|2012-12-27

Is it possible to use the 'date' function to select a date using the
date function as below?


        select * from general where foobar_date=date('-1 day');
E.g. return foobar_date of 2012-12-27 if today's date is 2012-12-28.
        select * from general where foobar_date=date('-2 days');
 E.g. return foobar_date of 2012-12-26 if today's date is 2012-12-28.

Neither of these return any output.  Date ranges in the table start at
2012-10-25 and go until 2012-12-27, so I was hoping one of the two
queries above would return something.

Or is it necessary to explicitly state the value desired, e.g.

        select * from general where foobar_date='2012-12-27';


Thanks for any suggestions.

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

Reply via email to