Example: NEXT_DAY Function - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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.