About the Business Calendar Tables
You can query business calendar tables to see calendar information relevant to your business.
DBC.BusinessCalendarPattern Table
This table records calendar information about patterns of business and non-business days.
Column Name |
Column Description |
CalendarName |
Business calendar name. |
PatternType |
Identifies the pattern as weekly, monthly, quarterly, or yearly. Currently, only the weekly pattern is supported. Pattern “W” indicates a weekly pattern. |
DayNumber |
The days in the week are numbered from 1 to 7, starting with Sunday as 1 and ending with Saturday as 7. There is one row in the table for each day, and the ON/OFF status for the day is stored in the Pattern column. |
Pattern |
A weekly pattern describes 7 rows, each set to 1 or 0. For each DayNumber, this column stores the status, whether it is a business day (1) or a non-business day (0). |
PatternComment |
A description of the pattern. |
CreatorName |
The name of the user who created or modified the pattern. For system-defined business calendars, this is DBC. |
LastModified |
The timestamp of the last pattern change. |
DBC.BusinessCalendarException Table
This table contains a list of days that are exceptions to the pattern of working and non-working days.
Column Name |
Column Description |
CalendarName |
Business calendar name to which the exception applies. |
ExceptionIndicator |
A value of 0 indicates that an ExceptionDate is a non-business day, and a value of 1 indicates that an ExceptionDate is a business day. |
ExceptionDate |
An ExceptionDate must fall within the Teradata calendar (January 1, 1900, to December 31, 2100). If the ExceptionDate is outside that period, it is not accepted. |
ExceptionReason |
The reason for the exception. For example, December 25, 2012 (a Tuesday) is normally a working day, but it is also the Christmas holiday, so the ExceptionReason is “Christmas.” The ExceptionReason may be NULL. |
CreatorName |
The name of the user who created the exception. |
CreationTime |
The timestamp of the exception creation. |
There are two types of exceptions:
You do not need to validate whether an OFF-exception falls on a business day and an ON-exception falls on a non-business day. Just set the exception, and specify an ExceptionReason. For example, Monday, July 4, is a holiday, but the Barbeque Bonanza store is open and your ExceptionReason is Independence Day Sale.