Page 1 of 1

Timestamp To Numeric

Posted: Mon Jul 13, 2015 5:26 am
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.

Posted: Mon Jul 13, 2015 5:30 am
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.

Posted: Mon Jul 13, 2015 5:58 am
by Kel
Thank you.

Posted: Mon Jul 13, 2015 6:03 am
by Kel
Will this also work for Integer datatype?

Posted: Mon Jul 13, 2015 7:10 am
by rkashyap
Yes, it will also work if output is integer. Also see Type conversion functions.