Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 17 Jul 2007 @ 10:25:49 GMT


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


Subj:   Re: Selecting date without quotes
 
From:   Anomy Anom

<-- Anonymously Posted: Tuesday, July 17, 2007 03:18 -->

          > create volatile table test
          > (col1 date )
          > on commit preserve rows;
          >
          > Insert into test (20080716) ;

Inserts the integer 20080716 - which translates to 3908-07-16 date

NB Dates are stored as integers ie 2007-07-17 would be stored as 1070717.


          > sel * from test where col1 = '3908-07-16'  ( since teradata
          > offsets from 1900/01/01)
          >
          > Ans: 3908-07-16

This is exactly as expected!


          > sel * from test where col1 = 3908-07-16 ;  /* no quotes here */
          >
          > Ans : no rows returned

An earlier post explained 3908 minus 7 minus 16 = 3885


          > But the above query doesnt prompt a 'failed conversion to
          > numeric' error.
          >
          > Can you tell me what date is teradata looking at when we
          > say 3908-07-16

See above


Regards



     
  <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