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
Harini
Premium Member
Posts: 80 Joined: Tue Mar 16, 2010 1:32 am
Post
by Harini » Thu Nov 04, 2010 6:51 am
Hello All,
Below is a varchar and i need to convert it to timestamp length 23, scale 3..
2009-01-15T00:08:13.109.
I used the below code and it doesnt work...
StringToTimestamp(DSLink316.DATE,"%yyyy-%mm-%dd %hh:%nn:%ss")
Any idea on the right code??
Thanks
ArndW
Participant
Posts: 16318 Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:
Post
by ArndW » Thu Nov 04, 2010 6:55 am
StringToTimestamp(DSLink316.DATE[1,10]:' ':DSLink316.DATE[12,12],"%yyyy-%mm-%dd %hh:%nn:%ss.3")
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Nov 04, 2010 7:13 am
In other words, by skipping the 'T' separator.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Harini
Premium Member
Posts: 80 Joined: Tue Mar 16, 2010 1:32 am
Post
by Harini » Thu Nov 04, 2010 8:22 am
ArndW wrote: StringToTimestamp(DSLink316.DATE[1,10]:' ':DSLink316.DATE[12,12],"%yyyy-%mm-%dd %hh:%nn:%ss.3") ...
Thanks, that worked !
ArndW
Participant
Posts: 16318 Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:
Post
by ArndW » Thu Nov 04, 2010 8:28 am
Craig - you gave away the secret
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Nov 04, 2010 10:13 am
D'oh!
-craig
"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Fri Nov 05, 2010 12:00 am
Just curious (and unable to check at the moment) - can you include the literal T in the format string? That would yield a simpler and self-documented solution.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.