All Forums General
jabbarahmed 1 post Joined 08/16
31 Aug 2016
Converting varchar into timestamp

Can someone please give me the exact code to convert the following varchar data into a teradata recognised timestamp format. I have searched through existing topics but have not found an exact match for the below formats.
May 25 2004  5:02:19:906AM

Please help!

Glass 225 posts Joined 04/10
01 Sep 2016

sel cast(substr('2016-01-07T11:52:49.113Z',1,10)||' '||substr('2016-01-07T11:52:49.113Z',12,12) as timestamp(3))
for the first, 
for the second you can use substr also, and use a case statement to convert month to numeric value

You must sign in to leave a comment.