Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 28 Jun 2007 @ 21:13:24 GMT


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


Subj:   How to get 5 digit month diff
 
From:   Kopuuravuri, Ramu

Looks like if number of months between two dates is greater than 4 digit, then this would not work. Any work around?

     select CAST (((( CURRENT_DATE - EXTRACT( DAY FROM CURRENT_DATE ) + 1)
                       - (date  '3000-12-31' ))  MONTH (4)) AS INTEGER )
     ;


     select CAST (((( CURRENT_DATE - EXTRACT( DAY FROM CURRENT_DATE ) + 1)
                       - (date  '2020-12-31' ))  MONTH (4)) AS INTEGER )
     ;

Regards,

Ramu.



     
  <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