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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ms access query and percentage Error

Status
Not open for further replies.

sparkee16

Technical User
Aug 27, 2008
2
I am trying to find out a percentage in a ms access query and getting an #error when both values are 0, not sure what to do? This is what I am using "COG: ([COST]/[SALES])"
I tried using this ""COG: Nz([COST]/[SALES],0)" but still get the #ERROR when both values are 0.
 
You cannot divide by zero. How about:

IIf([Sales]=0,Null,[Cost]/[Sales])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top