I can get week of year from sys_calendar but it assumes sunday as the first day of week.
How can I calculate week of year if I consider Monday to be the first day of week
Below SQl will help you to get week of year for week starting on monday.
SEL calendar_date, (day_of_year - (day_of_calendar -1) mod 7 + 6) / 7 as week_of_year
I have a slightly different requirement. Can someone please help? I need to get the week of the year from a date, but 1st of Jan being the 1st week. (no matter what day it falls on). How can I get this in Teradata sql?
For eg. 6 Jan 2013 is week 2.
Thank you so much.