You need a day of week function (RTFM for TO_CHAR), then if this represents Sunday as 0, Monday as 1 etc and if your offdays are Tuesday and Thursday then it's just if (day==2 || day==4) (using C syntax, but you can translate that into PL/SQL easily enough).