Converting Varchar to Timestamp

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Converting Varchar to Timestamp

Post by jweir »

Hello,

I am trying to convert a field that is varchar (8) to a timestamp (26,6).

I have tried the StringtoTimestamp function, which did not work. I have also tried PadString, but it was unsuccessful.

Does anyone have any suggestions?

Thanks in advance.
Jweir

--- If strength were all, tiger would not fear scorpion.
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Can you post your derivation having StringToTimestamp. Also give the sample value for that column
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

Sample value: 20100808

Derivation: StringToTimestamp((lnk_GL_BALANCES_MED.POSTING_DATE:'000000'),"%yyyy%mm%dd%hh%nn%ss")

This was the solution we found. We had to pad the hours, minutes, and seconds.
Jweir

--- If strength were all, tiger would not fear scorpion.
Post Reply