Page 1 of 1

Conversion to Timestamp

Posted: Mon Dec 22, 2014 4:21 am
by abhilashnair
My input is string and data will be like dd-Mon-yyyy
eg: 10-Dec-2010

I need to load the above as timestamp into target Teradata table

Please suggest

Posted: Mon Dec 22, 2014 5:50 am
by sarathchandrakt
You can just append 00:00:00 to the existing string

input.Column_Name:' 00:00:00'

Then use StingToTimestamp() function to convert it to timestamp

StringToTimestamp(input.column_name:' 00:00:00', "%dd-%mmm-%yyyy %hh:%nn:%ss")

Posted: Mon Dec 22, 2014 7:58 am
by ray.wurlod
What format of timestamp is your Teradata instance expecting?

Posted: Mon Dec 22, 2014 9:40 pm
by abhilashnair
The target Teradata table is expecting Timestamp without microseconds

Posted: Mon Dec 22, 2014 9:45 pm
by chulett
Sorry but that doesn't answer the question. What format is it expecting? Spell it out for us like YYYY-MM-DD HH... etc etc.

Posted: Mon Dec 22, 2014 9:53 pm
by abhilashnair
It is expecting yyyy-mm-dd hh:nn:ss

Posted: Mon Dec 22, 2014 11:42 pm
by abhilashnair
StringToTimestamp(input.column_name:' 00:00:00', "%dd-%mmm-%yyyy %hh:%nn:%ss")

The above worked for me