Timestamp To Numeric

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
Kel
Participant
Posts: 31
Joined: Mon May 11, 2015 3:20 am
Location: Robinsons Cybergate Tower 2
Contact:

Timestamp To Numeric

Post by Kel »

Hi Everyone,

I have a timestamp column and I wanted it to become a number with format yyyymmdd on the output of a transformer stage. Can anyone suggest method on obtaining this.

Thank you very much.
BOG
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Just do a TimeStampToString(Your.Column,"%yyyy%mm%dd") in a numeric column. The function will convert the timestamp to a string, and then an implicit string to numeric conversion will take place.
Kel
Participant
Posts: 31
Joined: Mon May 11, 2015 3:20 am
Location: Robinsons Cybergate Tower 2
Contact:

Post by Kel »

Thank you.
BOG
Kel
Participant
Posts: 31
Joined: Mon May 11, 2015 3:20 am
Location: Robinsons Cybergate Tower 2
Contact:

Post by Kel »

Will this also work for Integer datatype?
BOG
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

Yes, it will also work if output is integer. Also see Type conversion functions.
Post Reply