Example - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢

In the following example, a TIMESTAMP(6) literal is cast as PERIOD(DATE). The result beginning element is set to the date portion of the source value. The result ending element is set to result beginning bound plus INTERVAL '1' DAY.

SELECT CAST(TIMESTAMP '2005-02-03 12:12:12.340000' AS PERIOD(DATE));

The following is returned:

('2005-02-03', '2005-02-04')