How to handle #Errror in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following in a query and until some data comes at a later date it
will error out. Is it possible to use an IIF statement to return something
other than #error

Gross pct Change:
([Totals]![SumOfCY_Gross_Revenue]-[Totals]![SumOfLY_Gross_Revenue])/[Totals]![SumOfLY_Gross_Revenue]

Thank you for you assistance
 
Gross pct Change:
Iif(nz([Totals]![SumOfLY_Gross_Revenue],0)=0,0,([Totals]![SumOfCY_Gross_Revenue]-[Totals]![SumOfLY_Gross_Revenue])/[Totals]![SumOfLY_Gross_Revenue])

If SumOfLY_Gross_Revenue is Null or zero, return zero, otherwise return your
original calculation.

HTH,
 

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

Back
Top