Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 19 Jul 2006 @ 15:15:56 GMT


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


Subj:   Re: How to change date formats in views?
 
From:   Fred W Pluebell

FORMAT is only meaningful when Teradata does conversion to/from [VAR]CHAR. So, for example, the format in the view will be used in generating BTEQ reports. But for other applications (e.g. ODBC tools such as SQL Assistant), formatting is usually done by the client. An explicit CAST to [VAR]CHAR will cause Teradata to apply the FORMAT.

If you are developing a custom application, I'd recommend specifying the CAST and even the FORMAT in the SELECT statement. But if this is a view for end-user query or query tool use, that may not be an option. If this is a "display-only" field in the context of how the view will be used, you might just include the CAST within the view definition. If this is a field you will use in WHERE or ON criteria or is included in a PPI, though, that could introduce performance issues. In that case it might be worth including two "copies" of the same field in the view: one typed as DATE and used to qualify / join; the other cast to CHAR and used only for display.



     
  <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