Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 21 May 2004 @ 19:15:02 GMT


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


Subj:   How can I advance a date value?
 
From:   Duell, Bob

Using SQL, is there an easy way to advance a DATE value by some number of years, based on CURRENT_DATE?

For example, given a column EXPIRATION_DATE with the value '2002-03-15' (obviously in the past), I want to create a column NEW_DATE with the value '2004-03-15'.

     case
        when EXPIRATION_DATE < CURRENT_DATE
             then ???
             else EXPIRATION_DATE
        end as NEW_DATE

Thanks,

Bob Duell
Manager, Systems and Integration
AT&T Wireless Services; CRM Database Marketing



     
  <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