Examples: Querying the Number of Days from the Month Beginning - Analytics Database - Teradata Vantage

SQL Date and Time Functions and Expressions

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
2023-10-30
dita:mapPath
cpk1628111786971.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
pxz1544241488545
lifecycle
latest
Product Category
Teradata Vantage™

In both of the following examples, no business calendar is set for the session, so the query uses the system-defined business calendar Teradata.

The following query gives the day number of the month as 31 instead of 1 because the input is converted to UTC 2009-12-31 19:00:00.

SET TIME ZONE INTERVAL ‘05:00’ HOUR TO MINUTE;
SELECT DAYNUMBER_OF_MONTH (TIMESTAMP‘2010-01-01 00:00:00’);

The following query gives the day number of the month as 31 instead of 1 because the input is converted to UTC 2009-12-31 21:00:00.

SEL DAYNUMBER_OF_MONTH (TIMESTAMP’2010-01-01 00:00:00+03:00’);