I have a table which has amongst others a date column servdate.
I use the following query to get me all jobs from within the past week ( a week starts f
Here a suggestion involving less typing than the CASE ... WHEN block. Here, the same is done by substring extraction:
select substr('SunMonTueWedThuFriSat', 1 + 3*strftime('%w', timestr), 3) as dow
from ...
It produces only fixed length abbreviations instead of full weekday names, though. (But sometimes that's enough.)