Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 25 May 2004 @ 16:34:25 GMT


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


Subj:   Re: Substract 1 year from leap year - bug?
 
From:   Joseph Massena

Try this:

     sel  ADD_MONTHS((ADD_MONTHS(DATE-1,0)) - (EXTRACT(DAY FROM DATE-1)) +1, -3) "First Day",
          (ADD_MONTHS(DATE-1,-2)) - (EXTRACT(DAY FROM DATE-1)) "Last Day"

     sel  ADD_MONTHS((ADD_MONTHS(DATE-1,0)) - (EXTRACT(DAY FROM DATE-1)) +1, -15) "First Day",
          (ADD_MONTHS(DATE-1,-14)) - (EXTRACT(DAY FROM DATE-1)) "Last Day"

Joseph



     
  <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: 27 Dec 2016