string to timestamp conversion

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
marpadga18
Premium Member
Premium Member
Posts: 96
Joined: Fri Aug 20, 2010 8:51 am

string to timestamp conversion

Post by marpadga18 »

HI All,
my source has a varchar column DATE with following data :
8/3/2012 12:00:00 AM

My target should be like this
2012-08-03 00:00:00

I tried with date conversions but not getting exact output any ideas really appreciated Thanks M
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How about you show us what you tried, and tell us in what way you are not "getting exact output"?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
marpadga18
Premium Member
Premium Member
Posts: 96
Joined: Fri Aug 20, 2010 8:51 am

Post by marpadga18 »

StringToTimestamp(lnk_src_exl_onbase.DATE,"%(m,s)/%(d,s)/%yyyy%(H,s):%nn:%ss%aa")
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, that gets it to a timestamp. What is your target's data type? What output are you currently getting? If you need a particular format, convert it back to a string.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply