This article is written about how to use the Oracle/PLSQL NEXT_DAY function with syntax and examples.
The Oracle/PLSQL NEXT_DAY function returns the first weekday that is greater than a date.
The syntax for the NEXT_DAY function in Oracle/PLSQL is:
NEXT_DAY( date, weekday )
Parameters or Arguments
A date value used to find the next weekday.
The day of the week that you wish to return. It can be one of the following values:
SUNDAY First Sunday greater than date
MONDAY First Monday greater than date
TUESDAY First Tuesday greater than date
WEDNESDAY First Wednesday greater than date
THURSDAY First Thursday greater than date
FRIDAY First Friday greater than date
SATURDAY First Saturday greater than date
The NEXT_DAY function returns a date value.
The NEXT_DAY function can be used in the following versions of Oracle/PLSQL:
Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i
Let’s look at some Oracle NEXT_DAY function examples and explore how to use the NEXT_DAY function in Oracle/PLSQL.
NEXT_DAY('01-Aug-03', 'TUESDAY') Result: '05-Aug-03' NEXT_DAY('06-Aug-03', 'WEDNESDAY') Result: '13-Aug-03' NEXT_DAY('06-Aug-03', 'SUNDAY') Result: '10-Aug-03'