Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 31 Oct 2006 @ 13:02:05 GMT


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


Subj:   Re: Calculating Months between two dates
 
From:   Dieter Noeth

prahlad.patidar wrote:

  Could anyone please help me with following problem:  


  I need to calculate exact months between two given dates in Teradata. Can anyone suggest the way to do it or if any built-in function.  


The answer depends on your definition of "exact months between two given dates" :-)

Just show some example rows and expected result

e.g. there's ANSI interval syntax:

     select
       date '2006-09-20' - date '2006-08-21' month(4),
       date '2006-09-20' - date '2006-08-19' month(4),
       date '2006-09-20' - date '2006-08-20' month(4)

which results in 0,1,1


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