Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zero Denominator in Report

Status
Not open for further replies.

RLA

Instructor
Feb 22, 2002
22
US
Hi,
I am trying to divide in a report, but sometimes my denominator is equal to 0. So, I was trying to use Nz to return $0.00 if the denominator = 0 and to return the quotient if the denominator is not equal to zero. However, Nz returns my formula [textA]/[textB] rather than the correct number!!! Please help. This is my control property:
=IIf(Nz([textRSNO01])=0,"$0.00","[textRS01]/[textRSNO01]")
 
Hi!

Try this:

=IIf(Nz([textRSNO01]),0)=0,0,[textRS01]/[textRSNO01])

Set the format in your text box to currency.

hth
Jeff Bridgham
bridgham@purdue.edu
 
You have quoted the quotient so to speak.... try:

=IIf(Nz([textRSNO01])=0,"$0.00", Format([textRS01]/[textRSNO01],"$0.00"))

or better still:

=IIf(Nz([textRSNO01])=0,0,[textRS01]/[textRSNO01])

and format your control as appropriate. Best Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top