How to get the next date for a weekday using Oracle

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:

SELECT NEXT_DAY(SYSDATE - 1, 'SUN') FROM dual;

Valid entries for the day are: SUN, MON, TUE, WED, THU, FRI, and SAT

Tags: ,

Leave a Reply

Your email address will not be published.