Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Sat, 05 Nov 2016 @ 14:41:29 GMT


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


Subj:   Re: Teradata BTEQ - Invalid timestamp issue
 
From:   Dave Wellman

Hi,

To get this running in BTEQ you should probably match the actual date literal value with the FORMAT clause.

You currently have a date value of '20050614' but a FORMAT clause of 'YYYY-MM-DD'. These two do not match.

Try changing one or the other so that they match, e.g. '2005-06-14' or 'YYYYMMDD', something like:

     WHERE S_ORDER_ITEM.LAST_UPD  BETWEEN
        CAST( (('2005-06-14' (DATE, FORMAT'YYYY-MM-DD')) -1 (CHAR(10)) )|| ' ' || '22:00:01' AS TIMESTAMP(0))
            AND CAST( (('2005-06-14' (DATE, FORMAT 'YYYY-MM-DD')) (CHAR(10)) )|| ' ' || '22:00:00' AS TIMESTAMP(0) );

It may also depend on your version of Teradata. I'm using td15.10.1 and your original sql worked through both SQLA and BTEQ.

But I'd still change your code.


Cheers,

Dave

Ward Analytics Ltd - Information in motion (www.ward-analytics.com)



     
  <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: 24 Jul 2020