Examples | Period-to-Period Conversion | Teradata Vantage - 17.10 - Example: PERIOD(DATE) to PERIOD(TIMESTAMP) - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1143-171K
Language
English (United States)

Assume p is a PERIOD(DATE) column in table t1 with a value of PERIOD '(2005-02-02, 2006-02-03)' and the current session time zone displacement is INTERVAL -'08:00' HOUR TO MINUTE.

In the following example, a PERIOD(DATE) column is cast as PERIOD(TIMESTAMP(6)). The date portion is obtained from the source for the corresponding result element and the time portions are set to zero.

SELECT CAST(p AS PERIOD(TIMESTAMP(6))) FROM t1;

The following is returned:

('2005-02-02 00:00:00.000000', '2006-02-03 00:00:00.000000')