IsError function

I

inungh

I have following function in the query:

MyResult:IIF(IsError([MyField1]/[MyField2],0, [MyField1].[MyField2])

I want to myResult fiield has zero if (MyField1]/[MyField2]) is error.
The function seems return right result if there is not error, but
MyResult field returns #Error.

Am I on the right track or what I am missign here?

Your information is great appreciated,
 
A

Allen Browne

The error occurs if you divide by zero, so try:
IIf([MyField2] = 0, 0, [MyField1]/[MyField2])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

query with zero records 6
unique composite key 6
object required 8
select top 5 4
add new fileds 1
sub query 3
Reverse Crosstab issue 1
Parsing a recordset from an Oracle DB in Word with VBA 0

Top