Dividing by 0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a querry. THe formula might have a denominator with a
0 in it. I want the formula to input a "0" as the result if it's <1 or put
the actual number in it if it's =<1. Here's my formula.

([GP]+[PG])/[TH]

Now [TH] is another formula that is TH: [REG]+[OT]

[GP], [PG] [REG], [OT] are all inputed numbers.
I have tried IIF expressions but it's not working. Any suggestions?
 
dtx2junk said:
I am trying to create a querry. THe formula might have a denominator with a
0 in it. I want the formula to input a "0" as the result if it's <1 or put
the actual number in it if it's =<1. Here's my formula.

([GP]+[PG])/[TH]

Now [TH] is another formula that is TH: [REG]+[OT]

[GP], [PG] [REG], [OT] are all inputed numbers.
I have tried IIF expressions but it's not working. Any suggestions?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tried this?

Nz((GP + PG) / IIf((REG+OT) <> 0, REG+OT),0)

The above IIf() function defaults to NULL when (REG+OT) = 0, which will
cause the division to return NULL. When NULL returns, then Nz()
function returns zero as the result of the whole expression.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQgkcIIechKqOuFEgEQKXDQCg26ITsfPk+BllMFttHAvjLtKp4jMAnibQ
dHRUq9Y7vwWUoJJOTV2+Omqb
=xYDq
-----END PGP SIGNATURE-----
 
Back
Top