Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 14 May 2003 @ 16:23:58 GMT


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


Subj:   Re: Date Arithmetic
 
From:   Geoffrey Rommel

  Was wondering if there is a way to also calculate number of months and years between dates.  


 /* This is an interval. */
sel current_date - date '2001-01-02' year to month;

(Date - 2001-01-02) YEAR TO MONTH
---------------------------------
                             2-04

Because not all months are the same length, interval types cannot span months -- i.e., you can have a year-to-month interval, but not a year-to-day interval.

I have attached a document that should answer other questions of this kind. If John sees fit, he can post it on the Forum Web site.

(See attached file: howto_times2.htm)



Admin Comment: This document can be found at:

www.teradataforum.com/l030515a.htm



     
  <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