Skip to content

NEXT_DAY

  • date: This is the date from which the function will begin its search. It should be an expression that can be converted into a DATE datatype, typically found in the format ‘DD-MON-YY’, ‘DD-MON-YYYY’, ‘DD/MM/YY’, ‘DD/MM/YYYY’
  • char: This parameter represents the day of the week that the function should return. It should be a valid string expression that specifies the day (e.g., ‘MONDAY’, ‘TUESDAY’, etc.). The function will search forward from the supplied date to find the next occurrence of this day.
SELECT NEXT_DAY(TO_DATE('01-JAN-2022', 'DD-MON-YYYY'), 'FRIDAY') FROM dual;
07-JAN-22

In the provided example, the NEXT_DAY function is used to find the date of the next specified day of the week after a given date. The date ‘01-JAN-2022’ is used as the starting point and the function returns ‘07-JAN-22’, which is the date of the next ‘FRIDAY’.