Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Wed, 14 Feb 2001 @ 15:03:17 GMT





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




Subj:   Re: Datediff function
 
From:   David Wellman



Phil,

I don't know about the DateDiff perl function, but the value your seeing is (relatively) easy to explain. It is the value that Teradata stores internally for today's date. This internal format is also the default format that Teradata uses to return DATE values to a program. This can be over-ridden in different ways depending on what you want to achieve, but that's the default.

The break down is;
(Year - 1900) * 10000
+ Month * 100
+ Days

For today's date that is;
(2001 - 1900) * 10000 = 1010000
2 * 100 = 200
14 = 14

1010000 + 200 + 14 = 1010214

This may seem strange to you if you're new to Teradata, but that's the way it is.


Regards,

Dave





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