17.10 - PERIOD(TIMESTAMP) to PERIOD(TIME) - 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)

A PERIOD(TIMESTAMP(n) [WITH TIME ZONE]) value can be cast as PERIOD(TIME[(n)] [WITH TIME ZONE]) using the CAST function.

The date portion in the beginning and ending UTC values of the source must have the same DATE value. Otherwise, an error is reported. The time portions of the result elements are copied from the corresponding source time portions. If the target type specifies WITH TIME ZONE and the source also contains time zones, the source time zone displacements are copied to the corresponding result elements. If the source does not contain time zones, the current session time zone displacement is copied to both result elements.

If the target precision is higher than the source precision, trailing zeros are added to the fractional seconds. If the target precision is lower than the source precision, an error is reported.