Example: Number of Weeks in Each Quarter in 2004 - 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™

The following example shows the number of weeks in each quarter for 2004.

SEL quarter_of_year, MAX(week_of_quarter)
FROM  Sys_Calendar.BusinessCalendar
WHERE year_of_calendar=2004
GROUP BY 1 ORDER BY 1;
SET SESSION CALENDAR = Teradata;
Quarter_of_Year Maximum(Week_of_Quarter)
1 13
2 13
3 13
4 13
SET SESSION CALENDAR = ISO;
Quarter_of_Year Maximum(Week_of_Quarter)
1 13
2 13
3 13
4 14
SET SESSION CALENDAR = COMPATIBLE;
Quarter_of_Year Maximum(Week_of_Quarter)
1 13
2 13
3 14
4 14