Chapter 4: SQL Language Elements
4.9.2.54 NEXT_DAY function (extension)
Syntax
NEXT_DAY ( date_expression, day_of_week )
Description
The scalar function NEXT_DAY returns the minimum date that is greater than the date corresponding to the first argument for which the day of the week is same as that specified by the second argument.
Example
SELECT NEXT_DAY (order_date, 'MONDAY')
FROM orders ;
Notes
- The first argument to the function must be of type DATE.
- The second argument to the function must be of type CHARACTER. The result of the second argument must be a valid day of week ('SUNDAY', 'MONDAY' etc.)
- The result is of type DATE.
- If any of the argument expressions evaluates to null, the result is null.