Percentage for zero gives error

D

Dennis

In a report I have an expression:

Pct of Budget Spent: ([Expenditures Optical Concat]!
[SumOfAMOUNT]/[tblBudgetSubtype]![OpticalBudgeted])

When the value in both of the above fields are 0, the
reports shows "#error" Otherwise, it produces the correct
result.

When I use this expression in the same report:

=[Text48]/[BudgetTypeTotal]

The Text48 field has the following expression in it:

Unspent Balance: Sum([tblBudgetSubtype]![OpticalBudgeted]-
[Expenditures Optical Concat]![SumOfAMOUNT])

The report shows "#Num!". All fields with numbers show the
correct percentage and all numbers are formatted as
currency. What am I missing? Thanks Dennis
 
M

Michel Walsh

Hi,


Try:


Pct of Budget Spent: ([Expenditures Optical Concat]!
[SumOfAMOUNT] / iif( 0=tblBudgetSubtype.OpticalBudgeted , 1,
tblBudgetSubtype.OpticalBudgeted )



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top