TO_DATE Function | Data Types and Literals | Teradata Vantage - TO_DATE - 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
Publication Date
June 2022
Content Type
Data Types
SQL Reference
Publication ID
B035-1143-172K
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
ft:sourceId
dita
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantageā„¢

Converts string_expr to a DATE data type.

TO_DATE does not convert data to any of the other datetime data types. Do not use the TO_DATE function with a DATE value for string_expr. The first two digits of the returned DATE value can differ from the original string_expr depending on format_arg or the default date format.

TO_DATE is an overloaded scalar function whose return value data type is DATE.

ANSI Compliance

This statement is a Teradata extension to the ANSI SQL:2011 standard.

Syntax

[TD_SYSFNLIB.] TO_DATE ( string_expr, format_arg )

Syntax Elements

TD_SYSFNLIB.
Name of the database where the function is located.
string_expr

A character expression.

If the conversion fails, TO_DATE returns an error.

format_arg

A character argument.

format_arg is a data format specifying the format of string_expr.

If format_arg is omitted, the following default date format is used: YYYY-MM-DD

If format_arg is NULL, TO_DATE returns NULL.

If format_arg is not valid, an error is returned.

For more information, see format_arg Format Elements.