Coverting Char to Date

Analytics
Highlighted

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
Enthusiast

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

Enthusiast

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 :)

Enthusiast

Re: Coverting Char to Date

Bonjour,


Ceci est déjà répondu à


https://forums.teradata.com/forum/enterprise/to-check-is-a-string-is-numeric-or-not


Khurram


 


Khurram
Enthusiast

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