Date Literals - Teradata Vantage - Analytics Database

SQL Data Types and Literals

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantageā„¢

Declares a date value in ANSI DATE format in an expression.

ANSI DATE literal is the preferred format for date constants. All date operations accept this format.

Syntax

DATE 'string'

Syntax Elements

string
A 10-character string enclosed in apostrophes in the following form:
YYYY-MM-DD
  • YYYY represents year. The valid range is 0001 through 9999, inclusive. You must specify all four digits.
  • MM represents month. The valid range is 01 through 12, inclusive. You must specify both digits.
  • DD represents day. The valid range is 01 through 31, inclusive, constrained by Gregorian calendar definitions. You must specify both digits.

Usage Notes

Date literals consist of the word DATE followed by a character string literal. This character string specifies the date value.

The year, month, and day components of the string literal must be separated by hyphens.

Spaces and new line characters are not allowed in a literal except after the keyword DATE.

Data Type

DATE

Example: Date Literals

The following example selects all classes from the Classes table that start on January 6, 1998.

SELECT *
FROM CLASSES
WHERE startdate = DATE '1998-01-06';

Related Information

For information on DATE data types, see DATE Data Type.