All Forums Database
ASR 2 posts Joined 05/12
09 May 2012
Converting CHAR to DATE



I'm very much new to Teradata and writting queries as such. I have a CHAR Type column which contains data as follows

'2012-01-20 02:32:37.000000'.


How do I convert this CHAR type data to DATE Type, preferably as a timestamp?




alvie 32 posts Joined 03/12
09 May 2012

Cast('2012-01-20 02:32:37.000000' as Timestamp(6));


ASR 2 posts Joined 05/12
09 May 2012

Thanks a lot Alvie.



realrx7 17 posts Joined 06/12
19 Jun 2012

What does the (6) in the parenthesis indicate?

D3V1L 10 posts Joined 01/12
26 Jun 2012

The TIME and TIMESTAMP data types have a number (from 0 to 6) of fractional seconds in the seconds field which can be specified or defaults to 6 .


Experience is what we get, when we don't get what we want!

You must sign in to leave a comment.