Data Type Compatibility and Conversion | Teradata Vantage - Data Type Compatibility and Conversion - Analytics Database - Teradata Vantage

SQL Date and Time Functions and Expressions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
cpk1628111786971.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
pxz1544241488545
lifecycle
latest
Product Category
Teradata Vantageā„¢

The following rules apply to assignments involving ANSI DateTime or Interval data types:

Source Type Target Type Description
DATE DATE The types are compatible and assignments do not require conversion.

For compatibility with existing Teradata assignments, non-ANSI operations such as assigning a DATE to an INTEGER or an INTEGER to a DATE (with validity checking) follow existing Teradata assignment rules.

TIME TIME The types are compatible and assignments do not require conversion.

The Teradata system value TIME is encoded as a REAL and is not compatible with ANSI TIME or TIME WITH TIME ZONE.

TIMESTAMP TIMESTAMP The types are compatible and assignments do not require conversion.
Year-Month INTERVAL Year-Month INTERVAL
Day-Time INTERVAL Day-Time INTERVAL
Numeric DATE Vantage performs implicit type conversion before the assignment.

For more information, see Teradata Vantageā„¢ - Data Types and Literals, B035-1143.

DATE
  • Character
  • Numeric
  • TIMESTAMP
Character
  • DATE
  • TIME
  • TIMESTAMP
TIME TIMESTAMP
TIMESTAMP
  • DATE
  • TIME
Interval
The INTERVAL type must have only one field. For example, INTERVAL YEAR.
Exact Numeric
Exact Numeric Interval

For all other source/target data type combinations in assignments involving ANSI DateTime or Interval data types, the types must be explicitly converted.

To perform explicit conversions on ANSI DateTime or Interval data types, use the CAST function.