If you ever need to find the next weekday from a given date in Oracle it turns out they have a built in function for doing just that. If you want the next Sunday from yesterday you would do:
[code lang=”sql”]
SELECT NEXT_DAY(SYSDATE – 1, ‘SUN’) FROM dual;
[/code]
Valid entries for the day are: SUN, MON, TUE, WED, THU, FRI, and SAT
[tags]Oracle, SQL[/tags]