/ Published in: SQL
                    
                                        
A few examples of the Oracle NEXT_DAY function.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
--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;
URL: http://www.databasestar.com/oracle-next_day/
Comments
 Subscribe to comments
                    Subscribe to comments
                
                