I have a field named: pa_value which keeps varchar records
Now this field contains records like:
- 0.5582%
- 0.6985%
- -0.1589%
- 0.9856%
- -0.6589%
I'm getting these results using the following code:
CAST (replace (p7.pa_value ,'%','') AS float (3,0)) as TotalMargin
What I'm trying to do is to remove everything and leave just 2 characters(or 3 if there is a -(minus) infront of the string). It should be looking like this:
- 55
- 69
- -15
- 98
- -65
I tried to cast it as a float and then to convert it to integer. I also tried the floor command, which is not for my case, without any success. I believe that there is no way to do this.