Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 19 Dec 2006 @ 19:06:23 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023