Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 14 Feb 2001 @ 18:31:26 GMT


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


Subj:   Re: Datediff function
 
From:   Glenn McCall

I don't know why you are hanging, but Teradata stores its dates (DATE datatype) with the year offset from 1900. So your date 1010214 is 101 years from 1900 (i.e. 2001) February 14. This was quite intuitive before 2000 where for example Feb 14, 1999 would have been 990214.

You might try putting a format on your query or columns definition. For example

     CT test (
        ...
        dt date (format 'yyyymmdd')
        ...
     )

     or select ..., date (format 'yyyymmdd'), ...

or you could simply add 19000000 to the integer you got back

       1010214
     +19000000
      --------
      20010214

Hope this helps

Glenn Mc



     
  <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: 27 Dec 2016