percentage error message

  • Thread starter Thread starter LJG
  • Start date Start date
L

LJG

Hi Guys,

Any suggestions why I am getting the #error with this

Margin: Nz([gp],0)/Nz([discount1],0)/100

This happens if the field discount has a value of 0
 
You can't divide anything by zero, so use IIf() to explicitly handle that
case:
Margin: IIf([discount1] = 0, 0, [gp] / [discount1])

You may end up with:
Margin: CCur(Nz(IIf([discount1] = 0, 0, [gp] / [discount1]),0))
 

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

Back
Top