Archives of the TeradataForum
Message Posted: Tue, 19 Dec 2006 @ 19:06:23 GMT
Subj: | | Re: Finding the last Friday of the year |
|
From: | | Michael Larkins |
Mugdha:
I think this is how I would do what you are asking for:
sel * from sys_calendar.calendar c
where year_of_calendar = 2006 and
month_of_year = 12 and
day_of_week = 6 and
weekday_of_month = (sel max(weekday_of_month) from
sys_calendar.calendar
where c.month_of_year=month_of_year)
Granted, this is for the current year, but you could set it up for any single or range of years based on the Year_of_calendar
comparison.
Hope this helps,
Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor
|