On 5/11/2011 8:30 PM, Igor Tandetnik wrote:

> select case strftime('%w', 'now')
>       when 0 then sunday_value
>       when 1 then monday_value
>       ...
>       else saturday_value
>     end
> from seven_days;

Make it

select case cast(strftime('%w', 'now') as integer) ...

-- or

select case strftime('%w', 'now')
        when '0' then sunday_value
        when '1' then monday_value ...

strftime returns a string, so a bit of care is needed to make it work 
with integers.
-- 
Igor Tandetnik

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

Reply via email to