Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Fri, 13 Jul 2007 @ 15:59:49 GMT


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


Subj:   Re: varhar(8) to date
 
From:   nithya.r

From: Marwaha, Vivek

  select cast(doj(varchar(8)) as date format 'yyyy-mm-dd' ) from edw_work.vips I gives error invalid date supplied to the table.Plz tell me the possible solution.'  


Check the source column to see in what format the data is stored. If the data is store in 'yy-mm-dd', then your select statement needs to be select cast(doj as date format 'yy-mm-dd' ). If the data is in 'dd-mm-yy' Then your select statement needs to be select cast(doj as date format 'dd-mm-yy' ).

Teradata can insert value from one type of date column into another type by converting it internally. So all you have to do in your select statement cast is to match the format your text column comes in.


Nithya



     
  <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: 28 Jun 2020