Example: PERIOD(DATE) to PERIOD(TIMESTAMP)

Teradata Vantageā„¢ Data Types and Literals

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

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