Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 01 Sep 2004 @ 15:37:51 GMT


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


Subj:   Re: Generating week dates without sys_calendar
 
From:   Toryn_Howe

I like to use the same logic as is in the CALENDARTMP view for simplicity:

TD uses:

,       (day_of_year - (day_of_calendar + 0) mod 7 + 6) / 7
                  /* CALENDARTMP.week_of_year */

Becomes something like:

,       (day_of_year - (day_of_calendar + 6) mod 7 + 6) / 7
                  AS monday_week_of_year

-Toryn



     
  <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