Oracle NEXT_DAY Function


/ Published in: SQL
Save to your folder(s)

A few examples of the Oracle NEXT_DAY function.


Copy this code and paste it in your HTML
  1. --NEXT_DAY
  2.  
  3. --Example 1
  4. SELECT SYSDATE,
  5. NEXT_DAY(SYSDATE, 'THURSDAY') AS next_date_example
  6. FROM dual;
  7.  
  8. --Example 2 - same day as today
  9. SELECT SYSDATE,
  10. NEXT_DAY(SYSDATE, 'WED') AS next_date_example
  11. FROM dual;
  12.  
  13. --Example 3 - timestamp
  14. SELECT SYSTIMESTAMP,
  15. NEXT_DAY(SYSTIMESTAMP, 'SUN') AS next_date_example
  16. FROM dual;
  17.  
  18. --Example 4 - invalid day
  19. SELECT SYSDATE,
  20. NEXT_DAY(SYSDATE, 'W') AS next_date_example
  21. FROM dual;
  22.  
  23. --Example 5 - entered date
  24. SELECT NEXT_DAY('24-JUN-2016', 'THU') AS next_date_example
  25. FROM dual;

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.