Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 07 Jul 2006 @ 14:10:27 GMT


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


Subj:   Re: Error with timestamp calculation
 
From:   Victor Sokovin

  1 - Why I get different results from queryman and bteq ?  


SQLA uses the ODBC driver which sometimes (especially when the so called ODBC extensions are enabled) translates your original SQL into something which you probably would not approve. To check whether the problem comes from this translation process, enable the ODBC logging in you ODBC Admin and inspect the SQL which SQLQ generates.


  2 - How can I subtract '000 00:00:00.000001' from a timestamp ?  


     SELECT current_timestamp, current_timestamp - cast ('000
     00:00:00.000001' AS
     INTERVAL DAY(4) TO SECOND(6) );

      *** Query completed. One row found. 2 columns returned.
      *** Total elapsed time was 1 second.

                 Current TimeStamp(6)   (Current TimeStamp(6)-'000
     00:00:00.0000
     --------------------------------
     ------------------------------------------
     2006-07-07 10:57:08.320000+00:00             2006-07-07
     10:57:08.319999+00:

Regards,

Victor



     
  <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