Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 16 Jan 2008 @ 17:23:40 GMT


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


Subj:   Re: Convert time from twenty four hour to twelve hour format
 
From:   Geoffrey Rommel

  When doing a CAST, you can only convert the data to a data type, not a format.  


Sorry, Michael, but you are uncharacteristically mistaken. The original expression --

     cast(cast(HALF_HR_STRT_TM as format 'HH:MI:SSBT')
         as varchar())

does work. It is true, however, that formats and data types are not the same. In the inner cast, the data type is still TIME; thus the outer cast is necessary.

Perhaps you meant that using a format in place of a data type is not documented. As an extension, Teradata allows a data_type_list, which is "data type or data attributes or both". The manual gives no examples, but I take it that a format is a data attribute. If so, this usage is documented, although sketchily.



     
  <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