15.10 - BusinessCalendar - Teradata Database

Teradata Database Data Dictionary

Product
Teradata Database
Release Number
15.10
Content Type
Administration
User Guide
Publication ID
B035-1092-151K
Language
English (United States)

Operations

Sys_Calendar

 

View Column

Data Type

Format

Source Table.Column

calendar_date

DATE

YY/MM/DD

none

day_of_week

INTEGER

-(10)9

none

day_of_month

INTEGER

-(10)9

none

day_of_year

INTEGER

-(10)9

none

day_of_calendar

INTEGER

-(10)9

none

weekday_of_month

INTEGER

-(10)9

none

week_of_month

INTEGER

-(10)9

none

week_of_quarter

INTEGER

-(10)9

none

week_of_year

INTEGER

-(10)9

none

week_of_calendar

INTEGER

-(10)9

none

month_of_quarter

INTEGER

-(10)9

none

month_of_year

INTEGER

-(10)9

none

month_of_calendar

INTEGER

-(10)9

none

quarter_of_year

INTEGER

-(10)9

none

quarter_of_calendar

INTEGER

-(10)9

none

year_of_calendar

INTEGER

-(10)9

none

WeekBegin

DATE

YY/MM/DD

none

WeekEnd

DATE

YY/MM/DD

none

MonthBegin

DATE

YY/MM/DD

none

MonthEnd

DATE

YY/MM/DD

none

QuarterBegin

DATE

YY/MM/DD

none

QuarterEnd

DATE

YY/MM/DD

none

YearBegin

DATE

YY/MM/DD

none

YearEnd

DATE

YY/MM/DD

none

IsBusinessDay

BYTEINT

-(3)9

none

BusinessWeekBegin

DATE

YY/MM/DD

none

BusinessWeekEnd

DATE

YY/MM/DD

none

BusinessMonthBegin

DATE

YY/MM/DD

none

BusinessMonthEnd

DATE

YY/MM/DD

none

BusinessQuarterBegin

DATE

YY/MM/DD

none

BusinessQuarterEnd

DATE

YY/MM/DD

none

BusinessYearBegin

DATE

YY/MM/DD

none

BusinessYearEnd

DATE

YY/MM/DD

none

Note: As mentioned previously many views that do not end in V or VX are deprecated. However, although this view does not end in V or VX it is not deprecated.

Week_of_quarter

The week_of_quarter column can contain a range of possible values from 0 through 14.

The corresponding tables for this view are:

  • DBC.BusinessCalendarPattern
  • DBC.BusinessCalendarException
  • These examples show simple queries that you can use to determine the day of the week (day_of_week) and the date at the beginning of the week (weekBegin). The session calendars are the ISO and COMPATIBLE system-defined calendars.

  • Examples 1 and 2 provide queries that return the day of the week (for example, day 1, 2, or 7) for a particular date.
  • Examples 3 and 4 provide queries that return the date of the first day of a week (day 1) for the week to which a particular date belongs.
  • Example 1: Day of the Week (ISO Calendar)

    Sel day_of_week from Sys_Calendar.Calendar where calendar_date = date '2011-01-01';
     
    day_of_week
    -----------
    6

    Example 2: Day of the Week (COMPATIBLE Calendar)

    Sel day_of_week from Sys_Calendar.Calendar where calendar_date = date '2011-01-01';
     
    day_of_week
    -----------
    1

    Example 3: Beginning of the Week (ISO Calendar)

    Sel weekBegin from Sys_Calendar.BusinessCalendar where calendar_date = date '2011-01-01';
     
    WeekBegin
    -----------
    10/12/27
     

    Example 4: Beginning of the Week (COMPATIBLE Calendar)

    Sel weekBegin from Sys_Calendar.BusinessCalendar where calendar_date = date '2011-01-01';
    WeekBegin
    -----------
    11/01/01

    For more information about the following topics, see SQL Functions, Operators, Expressions, and Predicates:

  • Teradata, ISO, and COMPATIBLE system-defined business calendars
  • How the basic units (weeks, months, quarter, and year) of the ISO system-defined calendar are defined
  • Business calendar functions