Setting a Derivation to '0001-01-01'

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
ScottDun
Participant
Posts: 61
Joined: Thu Dec 10, 2015 9:51 am

Setting a Derivation to '0001-01-01'

Post by ScottDun »

Hi,

I am trying to default a column, with a Timestamp datatype, to '0001-01-01'. Is there a function that will do that? I typed in the 0001-01-01 and all that was returned were stars because I did not have a function. Any help would be great. Thanks!
SCOTTDun
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

StringToTimestamp. And you'll need a time as well, even if it's all zeroes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ScottDun
Participant
Posts: 61
Joined: Thu Dec 10, 2015 9:51 am

Post by ScottDun »

StringToTimestamp(0001-01-01 00:00:00,[%"%yyyy-%mm-%dd %hh:%nn:%ss"%])

I input this and it isn't working.
SCOTTDun
ScottDun
Participant
Posts: 61
Joined: Thu Dec 10, 2015 9:51 am

Post by ScottDun »

I also took out the '%' in front and back of the quotes....

StringToTimestamp(0001-01-01 00:00:00,["%yyyy-%mm-%dd %hh:%nn:%ss"])
SCOTTDun
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post by samyamkrishna »

Try
StringToTimestamp("0001-01-01 00:00:00","%yyyy-%mm-%dd %hh:%nn:%ss")
Cheers,
Samyam
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You need quotes around your string and there's no square brackets needed.

:!: Also there's no need to quote everything all the time, rather than 'Reply with quote' simply use the Reply to topic link. Save the quoting for when it makes sense.
Last edited by chulett on Mon Dec 21, 2015 3:40 pm, edited 1 time in total.
-craig

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