Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Fri, 26 Oct 2012 @ 16:09:45 GMT


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


Subj:   Re: How to Convert a VARCHAR date into TIMESTAMP(0) format
 
From:   Anomy Anom

< -- Anonymously Posted: Friday, October 26, 2012 10:11 -- >

How about something like this?

     select '20121024 11:46:13' as a
        , (    substring(a from 1 for 4)
           || '-' || substring(a from 5 for 2)
           || '-' || substring(a from 7) )(timestamp(0)) as b
        , add_months(b,1) as c
        ;

Returns:

     a                   b                     c
     20121024 11:46:13   10/24/2012 11:46:13   11/24/2012 11:46:13


     
  <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