Re: [sqlite] generating mini-calendar: DATE and quoting...

2011-02-10 Thread fearless_fool
@igor, @jay (and a good assist from @samuel): Cool beans -- that works and is cleaner than my hack. Thank you. FYA, the final form of this query (to be used as a sub-query throughout much of our system) is: > SELECT DATE('#{start_time.to_s(:db)}', (thousands.digit * 1000 + >

Re: [sqlite] generating mini-calendar: DATE and quoting...

2011-02-10 Thread fearless_fool
Meh. I have a solution, but I don't like it very much because it feels convoluted: > sqlite> select strftime('%Y-%m-%d', julianday('2011-01-01') + digit) as d > from digits; > 2011-01-01 > 2011-01-02 > 2011-01-03 > 2011-01-04 > 2011-01-05 > 2011-01-06 > 2011-01-07 > 2011-01-08 > 2011-01-09 >

Re: [sqlite] generating mini-calendar: DATE and quoting...

2011-02-10 Thread fearless_fool
Samuel Adam-2 wrote: > > > http://www.sqlite.org/lang_datefunc.html > http://www.sqlite.org/lang_select.html > (and a few others) > Very truly, > Hi SA: So I've been reading those very pages carefully. And since the docs say > Note that "±NNN months" works by rendering the original date

[sqlite] generating mini-calendar: DATE and quoting...

2011-02-10 Thread fearless_fool
I'd like to write a query that generates ten consecutive days starting at "2011-02-05" (for example), but I believe I'm having trouble with quoting. Assume I have a table of ten digits such as: CREATE TABLE "digits" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "digit" integer) INSERT INTO