#Num!

  • Thread starter Thread starter K
  • Start date Start date
K

K

How do I remove this #Num! from a report. I am divinding the Material Issued
Qty (Lbs) from the Ammount of loss Qty (Lbs) for a percentage of material
loss. Sometimes there is no Material Issued. Is there an if statment I can
use.

Tx Kyle.
 
If Material Issued is 0 or Null you can't use it as a divisor.
You can use an expression like this to cure the problem. The issue is what
do you return if Material Issued is Null or 0? That will have an impact on
how the expression is written.
This version will retun 0 if Material Issued is Null or 0:
=Iif(Nz([Material Issued],0) = 0, 0, [AmountOfLoss] / [Material Issued])

This version will return the value of [AmountOfLoss]:
=[AmountOfLoss] / Nz([Material Issued],1)
 
Thank you, This expresion worked.

=Iif(Nz([Material Issued],0) = 0, 0, [AmountOfLoss] / [Material Issued])

I appreciate it!.

Klatuu said:
If Material Issued is 0 or Null you can't use it as a divisor.
You can use an expression like this to cure the problem. The issue is what
do you return if Material Issued is Null or 0? That will have an impact on
how the expression is written.
This version will retun 0 if Material Issued is Null or 0:
=Iif(Nz([Material Issued],0) = 0, 0, [AmountOfLoss] / [Material Issued])

This version will return the value of [AmountOfLoss]:
=[AmountOfLoss] / Nz([Material Issued],1)

--
Dave Hargis, Microsoft Access MVP

K said:
How do I remove this #Num! from a report. I am divinding the Material Issued
Qty (Lbs) from the Ammount of loss Qty (Lbs) for a percentage of material
loss. Sometimes there is no Material Issued. Is there an if statment I can
use.

Tx Kyle.
 
Glad I could help.
Remember, you can never divide by 0 and Null cannot be used in any
mathmatical calculation. It is always a good practice to check for those
conditions when you have a calculation to do.
--
Dave Hargis, Microsoft Access MVP


K said:
Thank you, This expresion worked.

=Iif(Nz([Material Issued],0) = 0, 0, [AmountOfLoss] / [Material Issued])

I appreciate it!.

Klatuu said:
If Material Issued is 0 or Null you can't use it as a divisor.
You can use an expression like this to cure the problem. The issue is what
do you return if Material Issued is Null or 0? That will have an impact on
how the expression is written.
This version will retun 0 if Material Issued is Null or 0:
=Iif(Nz([Material Issued],0) = 0, 0, [AmountOfLoss] / [Material Issued])

This version will return the value of [AmountOfLoss]:
=[AmountOfLoss] / Nz([Material Issued],1)

--
Dave Hargis, Microsoft Access MVP

K said:
How do I remove this #Num! from a report. I am divinding the Material Issued
Qty (Lbs) from the Ammount of loss Qty (Lbs) for a percentage of material
loss. Sometimes there is no Material Issued. Is there an if statment I can
use.

Tx Kyle.
 
Back
Top