I have a float data type field that stored sales amount. What I'm trying to accomplish is to pull the specific digits from this field. For example
Amount_
5565295.24
I want to pull 952 two digit to the left of the decimal (95) and one digit to the right of the decimal (2). I want to use the charindex to locate the decimal position and substring function to pull it. But the charindex does not give me the correct position. Here is what I have
select *,charindex('.',Amount_) as position
from Sales_
result:
Amount_ position
5565295.24 2
I'm not sure if this the right approach. Your help/input is greatly appreciated.
Thanks
Amount_
5565295.24
I want to pull 952 two digit to the left of the decimal (95) and one digit to the right of the decimal (2). I want to use the charindex to locate the decimal position and substring function to pull it. But the charindex does not give me the correct position. Here is what I have
select *,charindex('.',Amount_) as position
from Sales_
result:
Amount_ position
5565295.24 2
I'm not sure if this the right approach. Your help/input is greatly appreciated.
Thanks