TO_DATE Function | Data Types and Literals | Teradata Vantage - 17.10 - TO_DATE - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Data Types and Literals

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

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.


[TD_SYSFNLIB.] TO_BYTES ( string_expr, format_arg )

Syntax Elements

Name of the database where the function is located.

A character expression.

If the conversion fails, TO_DATE returns an error.


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.