Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sat, 22 May 2004 @ 10:27:21 GMT


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


Subj:   Re: How can I advance a date value?
 
From:   Dieter Noeth

Hi Bob,

calculate the number of years between contract_disc_date and asof_date plus one, that's the number of years you'll have to add:

     case when CONTRACT_DISC_DATE < ASOF_DATE then
       add_months(CONTRACT_DISC_DATE,
         (cast (((ASOF_DATE - CONTRACT_DISC_DATE) year) as int) + 1) * 12)
     else CONTRACT_DISC_DATE
     end

This deals with leap years also, e.g. 2000-02-29 -> 2004-02-29

Dieter



     
  <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