Example: Show Week 1 of September 2011 - 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™

This example shows week 1 of September, 2011, for each business calendar setting.

SEL calendar_date, week_of_month FROM Sys_Calendar.BusinessCalendar
WHERE week_of_month = 1
AND month_of_year = 9
AND year_of_calendar = 2011
ORDER BY 1;
SET SESSION calendar = ISO;

Sep-2011 Calendar

S M T W T F S
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
calendar_date  week_of_month
-------------  -------------
     11/08/29              1
     11/08/30              1
     11/08/31              1
     11/09/01              1
     11/09/02              1
     11/09/03              1

11/09/04 1

SET SESSION calendar = Teradata;

Sep-2011 Calendar

S M T W T F S
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
calendar_date  week_of_month
-------------  -------------
     11/09/04              1
     11/09/05              1
     11/09/06              1
     11/09/07              1
     11/09/08              1
     11/09/09              1
     11/09/10              1
SET SESSION calendar = Compatible;

Sep-2011 Calendar

S M T W T F S
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
calendar_date  week_of_month
-------------  -------------
     11/09/01              1
     11/09/02              1
     11/09/03              1
     11/09/04              1
     11/09/05              1
     11/09/06              1
     11/09/07              1