Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 04 Feb 2004 @ 13:37:02 GMT


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


Subj:   Re: How to find the week-ending-date for a given date?
 
From:   Glen Blood

Look at SYS_CALENDAR.CALENDAR If you use Calendar date and day_of_week, you can quickly find the end date.

For instance, if week-ending-date was determined to be a Saturday (7 is Saturday, 1 is Sunday),

SELECT CALENDAR_DATE + (7 - day_of_week)
FROM SYS_CALENDAR.CALENDAR
WHERE CALENDAR_DATE = given_date;


     
  <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