Example: Returning the Current Date for INTERVAL -'09:00' HOUR TO MINUTE - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
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 '01:00' HOUR TO MINUTE;
   SELECT CURRENT_DATE AT INTERVAL '09:00' HOUR TO MINUTE;

The preceding SELECT statement returns the current date based on the time zone displacement, INTERVAL '09:00' HOUR TO MINUTE. If the current timestamp at UTC is TIMESTAMP '2008-06-01 19:30:00.000000+00:00', the SELECT statement would return '08/06/02' 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/01' as the current date based on the current session time and time zone displacement, INTERVAL '01:00' HOUR TO MINUTE.

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