@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 +
> hundreds.digit * 100 + tens.digit * 10 + units.digit) || ' days') AS date
>       FROM digits AS units
> INNER JOIN digits AS tens
> INNER JOIN digits AS hundreds
> INNER JOIN digits AS thousands
>      WHERE (thousands.digit * 1000 + hundreds.digit * 100 + tens.digit *
> 10 + units.digit) < #{ndays}
>   ORDER BY date
> 
I'll leave the actual result as an exercise to the reader, but it's a handy
function to have around.

- ff
-- 
View this message in context: 
http://old.nabble.com/generating-mini-calendar%3A-DATE-and-quoting...-tp30896927p30897388.html
Sent from the SQLite mailing list archive at Nabble.com.

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

Reply via email to