Purpose
You can call this function to return the date of the day of week specified by week in the week after the week that contains date.
Syntax
NEXT_DAY (date,week)
Parameters
| Parameter | Description |
|---|---|
| date | A value of the DATE data type. |
| week | A day of week. Valid values: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, and SATURDAY |
Return type
The return type is DATE.
Examples
The following example returns the date value of each weekday in the next week.
obclient> SELECT SYSDATE "Current date",
NEXT_DAY(SYSDATE,'MONDAY') "Next Monday",
NEXT_DAY(SYSDATE,'TUESDAY') "Next Tuesday",
NEXT_DAY(SYSDATE,'WEDNESDAY') "Next Wednesday",
NEXT_DAY(SYSDATE,'THURSDAY') "Next Thursday",
NEXT_DAY(SYSDATE,'FRIDAY') "Next Friday",
NEXT_DAY(SYSDATE,'SATURDAY') "Next Saturday",
NEXT_DAY(SYSDATE,'SUNDAY') "Next Sunday"
FROM DUAL;
+--------------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+
Current date Next Monday Next Tuesday Next Wednesday Next Thursday Next Friday Next Saturday Next Sunday
+--------------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+
17-NOV-21 22-NOV-21 23-NOV-21 24-NOV-21 18-NOV-21 19-NOV-21 20-NOV-21 21-NOV-21
+--------------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+
1 row in set