Returns the date of the first occurrence of the specified day of the week that is strictly later than the given date.
Syntax
NEXT_DAY(date, day_of_week)Arguments
| Argument | Description |
|---|---|
date | The starting date. If the value includes a time portion, the time is carried forward to the result unchanged. |
day_of_week | The target day of the week. Must contain at least the first three letters of the day name. |
Valid values for `day_of_week`:
| Full name | Accepted abbreviations |
|---|---|
SUNDAY | SUN |
MONDAY | MON |
TUESDAY | TUE |
WEDNESDAY | WED |
THURSDAY | THU |
FRIDAY | FRI |
SATURDAY | SAT |
Returns
Returns the first occurrence of the specified day that comes after date. The time portion of date is preserved in the result.
Examples
Return the first Sunday after August 13, 2007:
SELECT NEXT_DAY(TO_DATE('13-AUG-07','DD-MON-YY'),'SUNDAY') FROM DUAL;Output:
next_day
--------------------
19-AUG-07 00:00:00
(1 row)Return the first Monday after August 13, 2007 using the three-letter abbreviation:
SELECT NEXT_DAY(TO_DATE('13-AUG-07','DD-MON-YY'),'MON') FROM DUAL;Output:
next_day
--------------------
20-AUG-07 00:00:00
(1 row)