Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 10 Nov 2003 @ 22:13:07 GMT


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


Subj:   Re: Format of Date
 
From:   Anantaraman, Kumaran (K.)

Pat Belle wrote

  The double parens presumably conceal the format phrase from the ODBC parser. It ought to be possible to drop the typecast and the char(8), but I haven't been able to get it to work doing that.  



Its not the double parenthesis that conceals the format phrase. It is because, after casting to char(n) by Teradata server (which follows the format phrase), ODBC now sees a CHAR data type, as opposed to a DATE data type.

ODBC clients follow certain rules on how to display each data type. A DATE is displayed as YYYY-MM-DD. A CHAR is displayed as is.

SELECT
  (CAST(date AS DATE FORMAT 'MMDDYYYY')) (char(10)) as ODBC_sees_char_type,
  date as ODBC_sees_date_type
;


     
  <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