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

#Error 2

Status
Not open for further replies.

RonCT

Technical User
Dec 11, 2003
37
0
0
US
I'm trying to run a query with a simple calculation.
[#Services]/[#Members]
Some of the results are returned with #Error
Is there a way for the result to return 0 and not #Error?

Thanks!
 
Hi!

Instead of:

[#Services]/[#Members]

Use:

IIf([#Members] = 0, 0, [#Services]/[#Members])

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Or to catch NULLs
Code:
IIf([COLOR=red]NZ([/color][#Members][COLOR=red])[/color] = 0, 0, [#Services]/[#Members])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top