Page 1 of 1

Function to extract scale part of a Decimal value

Posted: Sun Sep 15, 2013 10:41 pm
by suja.somu
source column is a decimal data type of (7,2).

Data in source :

123.34
3456.45
12.45
8.1

Question is: what is the funtion that I can use to extract the scale part of the decimal

as in source



123.34 --> 34
3456.45 --> 45
12.45 --> 45
8.1 --> 1

Posted: Mon Sep 16, 2013 1:01 am
by chandra.shekhar@tcs.com
You can use any of the below functions to get the o/p :-

1) MantissaFromDecimal(<Column1>)
2) Field(<Column1>,'.',2)

Posted: Mon Sep 16, 2013 2:58 am
by ray.wurlod
Or even fieldname - Int(fieldname), multiplied by 10**x where x is the number of digits.

Posted: Tue Sep 17, 2013 10:27 am
by suja.somu
Thanks for the input. Closing the post as resolved.