This Oracle tutorial explains 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 )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:
| Value | Description |
|---|---|
| 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:
Let's look at some Oracle NEXT_DAY function examples and explore how to use the NEXT_DAY function in Oracle/PLSQL.
For example:
NEXT_DAY('01-Aug-03', 'TUESDAY')
Output: '05-Aug-03'
NEXT_DAY('06-Aug-03', 'WEDNESDAY')
Output: '13-Aug-03'
NEXT_DAY('06-Aug-03', 'SUNDAY')
Output: '10-Aug-03'