Example: Returning the Current Date for INTERVAL -'05:45' HOUR TO MINUTE - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantage™

This example assumes that the default format for DATE values is 'yy/mm/dd'. Consider the following statements:

   SET TIME ZONE INTERVAL '10:00' HOUR TO MINUTE;
   SELECT CURRENT_DATE AT '05:45';
   SELECT CURRENT_DATE AT 5.75;

The above SELECT statements return the current date based on the time zone displacement, INTERVAL '05:45' HOUR TO MINUTE. If the current timestamp at UTC is TIMESTAMP '2008-06-01 17:30:00.000000+00:00', the SELECT statements would return '08/06/01' as the date.

If the SELECT statement was specified without an AT clause or with an AT LOCAL clause, and the DBS Control flag TimeDateWZControl is enabled, the statement would return 
'08/06/02' as the current date based on the current session time and time zone displacement, INTERVAL '10:00' HOUR TO MINUTE.

The date returned is not adjusted to account for the start or end of daylight saving time.