Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Thu, 02 Nov 2006 @ 09:46:51 GMT





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




Subj:   Re: Calculating Months between two dates
 
From:   manpreet.singh



I think the best way is to use system calender table.

     SELECT
          c1.month_of_calendar - c2.month_of_calendar
     FROM
          sys_calendar.calendar c1 , sys_calendar.calendar   c2
     WHERE
          c1.calendar_date = current_dt and c2.calendar_date = previous_dt

current_dt & previous_dt can be any date .

Just test it !!


Best Regards,

Manpreet





     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008