Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 22 Feb 2010 @ 20:17:52 GMT


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


Subj:   Age calculation
 
From:   Anomy Anom

<-- Anonymously Posted: Monday, February 22, 2010 11:40 -->

We have used calculations of the ilk

     (DATE - DATE_OF_BIRTH) YEAR(4)

to calculate the age (of a customer) in years.

We are convinced that this calculation took into account the day and month of the current year and would therefore return the AGE based on whether the birthday had already occurred in the current year or not, i.e it would always return the actual age of the customer as at the day the query was executed.

We have now found that this is no longer the case and we are assuming that this change occurred when we upgraded to TD12. Unfortunately we don't have access to a V2R6 box to prove that the calculation used to work in the way we think it did.

Does anyone know if I'm mistaken about previous release behaviour or whether this is indeed a change in the Teradata calculation between releases and if so, is it a bug or an intentional change ?

The following demonstrates the issue, I would expect to see a mix of 1's and 0's in the result set, but the query returns all 1's.

     sel
     cdate
     ,(date-cdate) year(4)
      from  Sys_Calendar.caldates
      where
      cdate between '2009-01-01' and '2009-12-31'
     order by 1


     
  <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