calendar - logic for calculating ISO year from gregorian year and other fields -


as mentioned above need calculate iso year calendar view, have created view on top of calculating iso week number i'm unable figure out logic calculating iso year, can please post possible.

thanks in advance. kishor

structure of calendar view

replace view sys_calendar.calendar( 

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) sel calendar_date, daynumber_of_week(calendar_date), daynumber_of_month(calendar_date), daynumber_of_year(calendar_date), daynumber_of_calendar(calendar_date), dayoccurrence_of_month(calendar_date), weeknumber_of_month(calendar_date), weeknumber_of_year(calendar_date), weeknumber_of_calendar(calendar_date), monthnumber_of_quarter(calendar_date), monthnumber_of_year(calendar_date), month_of_calendar, quarternumber_of_year(calendar_date), quarter_of_calendar, yearnumber_of_calendar(calendar_date) sys_calendar.calendartmp;

if you're on modern version of teradata, can use td_sysfnlib.yearnumber_of_calendar(calendar_date,'iso')

if take 2014-12-31 example, iso week 1. function correspondingly return 2015 it's iso year.


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -