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
         (cast (((ASOF_DATE - CONTRACT_DISC_DATE) year) as int) + 1) * 12)

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


  <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