Hello everyone and Happy Holidays!
I have a query I am writing where I am getting data from another database and the data is in the form of a string - 0.89% and 0.74% (represented below by aa1 and aa2. I need to use that percentage along with another in a calculation and tried this:
TY/LY2: IIf(Val(Mid([aa2],1,InStr([aa2],"%"
)),Format(Val(Mid([aa1],1,InStr([aa1],"%"
))/Val(Mid([aa2],1,InStr([aa2],"%"
)),"Percent"
,"0.00%"
However, for some reason, VAL() insists on rounding UP, and so instead of 0.89/0.74, I get 1/1 and get a consistent 100%, which of course is totally inaccurate. I have tried all the 'C' functions as well (CDbl etc...) and they give me no better results.
Does anyone have an idea as to how I can accomplish this so I get a true percentage?
Thanks so much!
Rayna Man plans. God laughs.
I have a query I am writing where I am getting data from another database and the data is in the form of a string - 0.89% and 0.74% (represented below by aa1 and aa2. I need to use that percentage along with another in a calculation and tried this:
TY/LY2: IIf(Val(Mid([aa2],1,InStr([aa2],"%"
However, for some reason, VAL() insists on rounding UP, and so instead of 0.89/0.74, I get 1/1 and get a consistent 100%, which of course is totally inaccurate. I have tried all the 'C' functions as well (CDbl etc...) and they give me no better results.
Does anyone have an idea as to how I can accomplish this so I get a true percentage?
Thanks so much!
Rayna Man plans. God laughs.