Example 8 - Teradata Vantage - Analytics Database

SQL Data Types and Literals

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantage™

In this example, the tswz column in table1 contains the following timestamp data:

SELECT * FROM table1;

The result of the query is:

                               tswz
-----------------------------------
   2011-11-04 13:14:00.860000-07:00

You can use an AT clause with a time zone string in a SELECT query to get the same time in a different time zone. For example:

SELECT CAST(tswz AS TIMESTAMP WITH TIME ZONE AT 'gmt') 
FROM table1; 

The result of the query is:

                               tswz
-----------------------------------
   2011-11-04 20:14:00.860000+00:00

Similarly, you can use an AT clause with a time zone displacement to get the same result.

SELECT CAST(tswz AS TIMESTAMP WITH TIME ZONE AT TIME ZONE '00:00')
FROM table1; 

The result of the query is:

                               tswz
-----------------------------------
   2011-11-04 20:14:00.860000+00:00

The following query produces the same result without an explicit CAST:

SELECT tswz AT 'gmt' FROM table1;

The result of the query is:

            tswz AT TIME ZONE 'gmt'
-----------------------------------
   2011-11-04 20:14:00.860000+00:00