Examples: LAST_DAY Function - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Example: Querying for DATE for the Last Day of the Month

The following query:

SELECT LAST_DAY(DATE '2009-12-20'); 

returns the result 2009/12/31.

Example: Querying for TIMESTAMP for the Last Day of the Month

The following query:

SELECT LAST_DAY(TIMESTAMP '2009-08-25 10:14:59'); 

returns the result 2009/08/31.

Example: Querying for TIMESTAMP WITH TIME ZONE for the Last Day of the Month

The following query:

SELECT LAST_DAY(TIMESTAMP '2009-06-15 10:14:59-8:00');

returns the result 2009/06/30.