Example: NEXT_DAY Function - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

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.