w3resource

Oracle NEXT_DAY function

How to get the date of the first weekday in Oracle?

NEXT_DAY returns the date of the first weekday that is later than the date.

Syntax:

NEXT_DAY(date, char)

Parameters:

Name Description
date A date value used to get the next weekday.
char Day of the week, either the full name or the abbreviation.
The minimum number of letters required is the number of letters in the abbreviated version.
Any characters immediately following the valid abbreviation are ignored.

Return Value:

The return value has the same hours, minutes, and seconds component as the parameter date.

Pictorial Presentation

Pictorial Presentation of Oracle NEXT_DAY function

Examples: Oracle NEXT_DAY () function

This example returns the date of the next Monday after March 12, 2015 :

SQL> SELECT NEXT_DAY('12-MAR-2015','MONDAY') "NEXT DAY"
 2  FROM DUAL;

Sample Output:

NEXT DAY
--------------------
16-MAR-2015 00:00:00

Previous: NEW_TIME
Next: NUMTODSINTERVAL



Follow us on Facebook and Twitter for latest update.