Example: Querying for the First Tuesday after a Specified Date
The following query:
SELECT NEXT_DAY(DATE '2009-12-20', 'TUESDAY');
returns the result 2009/12/22 because 12/22 is the next Tuesday after Sunday, Dec 20, 2009.
Example: Querying for the First Friday after a Specified Date
The following query:
SELECT NEXT_DAY(DATE '2009-12-20', 'FRIDAY');
returns the result 2009/12/25 because 12/25 is the next Friday after Sunday, Dec 20, 2009.
Example: Querying for the First Friday after a Different Specified Date
The following query:
SELECT NEXT_DAY(DATE '2009-12-25', 'FRIDAY');
returns the result 2010/01/01 because Jan 1, 2010 is the next Friday after Friday, Dec 25, 2009.