djmurphy58
Technical User
In a query, I have an expression that calculates a percent over budget as follows:
% Over: Abs([Gain/Loss]/[ToDateBudget])
Compounding the matter is the fact that sometimes the loss is greater than zero, but the budget is zero. Since I can't divide a number by zero, PaulBricker helped me modify my expression as follows:
% Over: IIf([ToDateBudget] = 0,"No Budget",Abs([Gain/Loss]/[ToDateBudget]))
The problem with this is if the format of the query expression is "percent", then the text "no budget" will not show up, but the calculated percentages will. I want both.
So I changed the format of the expression to "standard" and multiplied the expression by 100. This allows the "no budget" to show up when applicable, AND it allows the calculated value to show - HOWEVER, it shows the calculated value with a ton of digits after the decimal point.
How do I show only 2 digits after the decimal point???? When I create a report based on the query, I try changing it in the field's properties on the report - from "Auto" to "2", but this doesn't work.
Thanks,
Dennis
% Over: Abs([Gain/Loss]/[ToDateBudget])
Compounding the matter is the fact that sometimes the loss is greater than zero, but the budget is zero. Since I can't divide a number by zero, PaulBricker helped me modify my expression as follows:
% Over: IIf([ToDateBudget] = 0,"No Budget",Abs([Gain/Loss]/[ToDateBudget]))
The problem with this is if the format of the query expression is "percent", then the text "no budget" will not show up, but the calculated percentages will. I want both.
So I changed the format of the expression to "standard" and multiplied the expression by 100. This allows the "no budget" to show up when applicable, AND it allows the calculated value to show - HOWEVER, it shows the calculated value with a ton of digits after the decimal point.
How do I show only 2 digits after the decimal point???? When I create a report based on the query, I try changing it in the field's properties on the report - from "Auto" to "2", but this doesn't work.
Thanks,
Dennis