Converting the String value into timestamp

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
nagarjuna900
Participant
Posts: 35
Joined: Mon Dec 29, 2008 2:22 am
Location: chennai

Converting the String value into timestamp

Post by nagarjuna900 »

HI,

i am getting the two fields from source file ( one is Date field, second field is Time field). The datatype of two fields is varchar. That two fields ( Date and Time) needs to converted as combination of DateTime, datatype is Timestamp.

Pl give me the possibility,

Thanks,
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Use StringToDate and StringToTime functions
StringToDate(Dt,"%yyyy-%mm-%dd") : StringToTime(Tm,"%hh:%nn:%ss")
You are the creator of your destiny - Swami Vivekananda
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why not StringToTimestamp(InLink.TheDate : " " : InLink.TheTime) ? If course your elements need to be in the appropriate ISO 8601 format for this to work.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply