Page 1 of 1

How can I reformat decimal data stored in a varchar field?

Posted: Wed Sep 03, 2008 3:03 pm
by tbtcust
Hi all,

I have a varchar field that is has decimal data. The data length is 19 the scale is 6. the data may or may not have leading zeros.

I need to keep all the numeric data before the period with the zeros suppressed and only the first 2 numbers after the period.

Is there a set of functions that can accomplish this?

Thanks in advance for any help.

Posted: Wed Sep 03, 2008 3:39 pm
by ray.wurlod
Server job (as marked) or parallel job (as posted)?

Posted: Wed Sep 03, 2008 3:43 pm
by tbtcust
It's parallel job. Sorry about that.

Posted: Wed Sep 03, 2008 4:49 pm
by tbtcust
ray, the following seems to be working

Col_1[1, (Len(Field(Col_1, ".", 1)) + 1) +2]

Posted: Wed Sep 03, 2008 5:11 pm
by ray.wurlod
Yes, but the answer would have been different in a server job. That's why I asked. Well done on finding a solution.

Have you tried StringToDecimal(InLink.Col_1) + 0?