CHANGE FORMAT FROM 02JUN2012:13:50:32.000000 TO DDMMMYY

Teradata Debugger

CHANGE FORMAT FROM 02JUN2012:13:50:32.000000 TO DDMMMYY

Hi,

Community, need your help:

column is 'actication date'

need to change format.

 

One question: HOW?)

3 REPLIES
Enthusiast

Re: CHANGE FORMAT FROM 02JUN2012:13:50:32.000000 TO DDMMMYY

SyntaxEditor Code Snippet

sel cast(cast(cast(substr('02JUN2012:13:50:32.000000', 1, 9) as date format 'ddmmmyyyy') as format 'ddmmmyy') as varchar(7));

Re: CHANGE FORMAT FROM 02JUN2012:13:50:32.000000 TO DDMMMYY

If I want to change date format in a column then I should use this:

sel cast(cast(cast(substr('activation_date', 1, 9) as date format 'ddmmmyyyy') as format 'ddmmmyy') as varchar(7));

???

Enthusiast

Re: CHANGE FORMAT FROM 02JUN2012:13:50:32.000000 TO DDMMMYY

That is what you would need to do to convert the format, assuming that the activation_date is defined as CHAR or VARCHAR.