[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 866
  • Last Modified:

MS Access - Check for #Error in calculation

I'm doing some math  ##/##
I don't want #Error in the results of the qry
If the ressult is #Error I want the the result to be set to NULL

How would I do this within a select
0
keschuster
Asked:
keschuster
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I'm assuming this is a divide-by-zero error? You didn't mention exactly what error you think it may be, so I'm assuming the standard.

You can use IIF:

YourCalculatedField: IIF(SomeField=0, Null, OtherField/SomeField)
0
 
keschusterAuthor Commented:
I resolved this by making the join a bit smarter by checking for null on the join instead of letting access tell me it was an error.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now