Division by 0

  • Thread starter Thread starter Greg Jesky
  • Start date Start date
G

Greg Jesky

I have a very small database with only 5 tables and not many fields per
table. I am trying to create a query that has a calculated field. However
the calculation requires me to divide one field by another field placing the
result in the calculated field of the query. All the fields in the query are
in one table. My problem is that sometimes the field that is the denominator
is zero. Is there anyway to check the denominator for zero before I perform
the divide?
Thanks,
Greg
 
Greg said:
I have a very small database with only 5 tables and not many fields per
table. I am trying to create a query that has a calculated field. However
the calculation requires me to divide one field by another field placing the
result in the calculated field of the query. All the fields in the query are
in one table. My problem is that sometimes the field that is the denominator
is zero. Is there anyway to check the denominator for zero before I perform
the divide?

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

column1 / IIf(column2 = 0, Null)

This will return NULL for the division when the value of column2 is
zero.

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

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

iQA/AwUBQiOXZ4echKqOuFEgEQIZUQCffM7ayCaSRtRty/QA8SHy3ebueDEAoOvM
lA38ernrT65chH5fMdxXVHfr
=kQph
-----END PGP SIGNATURE-----
 
Back
Top