Page 1 of 1

Decimal to Timestamp conversion

Posted: Mon Jan 29, 2007 6:55 pm
by gyani12
Hi,

I have input column as decimal(38,10) value as e.g "0000000000000000000020070123.0000000000" need to convert into timestamp as "2007-01-23 00:00:00"

What function I can use in transformer to convert from decimal to timestamp. Please provide info.

Regards
Gyani

Posted: Mon Jan 29, 2007 7:12 pm
by DSguru2B
Welcome Aboard :)
Apply DecimalToString(). Use Field() to get everything before the decimal and, concatenate the time and then use StringToTimestamp().

Posted: Mon Jan 29, 2007 7:55 pm
by ray.wurlod
Will the portion to the right of the decimal place ever contain the time portion? You need to plan for these contingencies, particularly if you seek to create re-usable components.

Extend the method suggested by DSguruji. Use the Field() function to retrieve all the digits to the right of the decimal place, then the Left() or Right() function as appropriate to yield the correct eight digits before converting to a time using StringToTime() function.