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

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
tpf1598412463935.ditamap
dita:ditavalPath
tpf1598412463935.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢

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')