CALENDAR in Teradata


Know about the days now !!!

You can get the following functionalities from the Teradata view sys_calendar.calendar

Functions:

calendar_date
day_of_week
day_of_month
day_of_year
day_of_calendar
weekday_of_month
week_of_month
week_of_year
week_of_calendar
month_of_quarter
month_of_year
month_of_calendar
quarter_of_year
quarter_of_calendar
year_of_calendar


Teradata will give the functionality between the following border dates. (It may vary with respect to the versions)

SEL MAX(CALENDAR_DATE) FROM SYS_CALENDAR.CALENDAR   -->  12/31/2100
SEL MIN(CALENDAR_DATE) FROM SYS_CALENDAR.CALENDAR   -->  01/01/1900


Examples:

SEL DAY_OF_YEAR FROM SYS_CALENDAR.CALENDAR    WHERE CALENDAR_DATE='2012-06-17'   
SEL DAY_OF_WEEK FROM SYS_CALENDAR.CALENDAR  WHERE CALENDAR_DATE='2012-06-17'   
SEL DAY_OF_MONTH FROM SYS_CALENDAR.CALENDAR  WHERE CALENDAR_DATE='2012-06-17'           
SEL DAY_OF_CALENDAR FROM SYS_CALENDAR.CALENDAR WHERE CALENDAR_DATE='2012-06-17'         
SEL WEEKDAY_OF_MONTH FROM SYS_CALENDAR.CALENDAR  WHERE CALENDAR_DATE='2012-06-17'         
SEL WEEK_OF_MONTH FROM SYS_CALENDAR.CALENDAR  WHERE CALENDAR_DATE='2012-06-17'     
SEL WEEK_OF_YEAR FROM SYS_CALENDAR.CALENDAR  WHERE CALENDAR_DATE='2012-06-17'       
SEL WEEK_OF_CALENDAR FROM SYS_CALENDAR.CALENDAR  WHERE CALENDAR_DATE='2012-06-17'      
SEL MONTH_OF_QUARTER FROM SYS_CALENDAR.CALENDAR  WHERE CALENDAR_DATE='2012-06-17'      
SEL MONTH_OF_YEAR FROM SYS_CALENDAR.CALENDAR  WHERE CALENDAR_DATE='2012-06-17'   
SEL MONTH_OF_CALENDAR FROM SYS_CALENDAR.CALENDAR WHERE CALENDAR_DATE='2012-06-17'       
SEL QUARTER_OF_YEAR FROM SYS_CALENDAR.CALENDAR   WHERE CALENDAR_DATE='2012-06-17'   
SEL QUARTER_OF_CALENDAR FROM SYS_CALENDAR.CALENDAR WHERE CALENDAR_DATE='2012-06-17'       
SEL YEAR_OF_CALENDAR FROM SYS_CALENDAR.CALENDAR WHERE CALENDAR_DATE='2012-06-17' 


Searching a Calendar now ?

Render a query to our Teradata master !!!



..