Example: Querying for Beginning of the Week and the Week Number - 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 query returns the beginning of the week and the week number for 2009, assuming that no calendar is set for the session. The session uses the default business calendar “Teradata.”

SEL WeekBegin, week_of_year FROM Sys_Calendar.BusinessCalendar WHERE calendar_date = DATE '2009-03-15'; 

Result:

Week_begin         week_of_year
-----------        -------------------
2009/03/15           11