Coverting Char to Date

Analytics

Coverting Char to Date

Hi,

I am new to Teradata.
In oracle if we want to convert char to date, we write like this e.g. to_date('20090417','YYYYMMDD').
Could you please tell me how to do that in teradata.

Thanks & Regards.
Roy
6 REPLIES
Teradata Employee

Re: Coverting Char to Date

Hello,

You can do that using CAST and FORMAT clause .... e.g. SELECT CAST('20090417' AS DATE FORMAT 'YYYYMMDD');

HTH!

Regards,

Adeel

Re: Coverting Char to Date

Hi,

I am a newer with the teradata fileld .

 

I find a sql statement wrote : AND lstg.auct_end_dt < date '$AUCT_END_DT'.

 

Is it mean to convert the value of the parameter $AUCT_END_DT' to date type?

 

Thanks

Re: Coverting Char to Date

Yes, but you might need to cast the parameter to a proper data format.

N/A

Re: Coverting Char to Date

BONJOUR

SVP, DE L'AIDE 

JE CHERECHE COMMENT UN CHAMP SI TOUT SES CARACTeRS  SE TROUVENT DANS UNE LISTE DE VALEURS!

PAR EXEMPLE: LA LISTE DE VALEUR EST '0987654321'

'12D5664'  NE SOIT PAS SELECTIONNE PARCEQUE IL A LE CARACTERE 'D'

'1275664'  SERA SELECTIONNE PARCEQUE TOUT CES CARATERES SONT DANS LISTE 

MERCI D'AVACE :)

Re: Coverting Char to Date

N/A

Re: Coverting Char to Date

hi roy_soumya

ya , i agree with the others , you can used function CAST for the convert char to date