Return to Snippet

Revision: 71296
at February 13, 2017 12:47 by bbrumm


Initial Code
--NEXT_DAY

--Example 1
SELECT SYSDATE,
NEXT_DAY(SYSDATE, 'THURSDAY') AS next_date_example
FROM dual;

--Example 2 - same day as today
SELECT SYSDATE,
NEXT_DAY(SYSDATE, 'WED') AS next_date_example
FROM dual;

--Example 3 - timestamp
SELECT SYSTIMESTAMP,
NEXT_DAY(SYSTIMESTAMP, 'SUN') AS next_date_example
FROM dual;

--Example 4 - invalid day
SELECT SYSDATE,
NEXT_DAY(SYSDATE, 'W') AS next_date_example
FROM dual;

--Example 5 - entered date
SELECT NEXT_DAY('24-JUN-2016', 'THU') AS next_date_example
FROM dual;

Initial URL
http://www.databasestar.com/oracle-next_day/

Initial Description
A few examples of the Oracle NEXT_DAY function.

Initial Title
Oracle NEXT_DAY Function

Initial Tags
sql, Oracle

Initial Language
SQL