Eliminating #Div/0! Errors

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

Guest

Hi,

I have a field called WeeklyRevenue and another called WeeklyTarget. I have
a calculated field in a report called PercToTarget which is WeeklyRevenue
divided by WeeklyTarget. There are some records that have no Weekly Target
and a zero is in the field for these records. Whenever, I create my report I
get an ugly looking #Div/0! error message. My preference is to have nothing
to appear in my report rather than this error. Is there a way in a query or
report to make this happen?

Thanks,
 
Chuck:

For the Control Source of the Report textbox you could have:

=IIF(WeeklyTarget<>0, WeeklyRevenue/WeeklyTarget,"N/A")

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hi,

I have a field called WeeklyRevenue and another called WeeklyTarget. I have
a calculated field in a report called PercToTarget which is WeeklyRevenue
divided by WeeklyTarget. There are some records that have no Weekly Target
and a zero is in the field for these records. Whenever, I create my report
I
get an ugly looking #Div/0! error message. My preference is to have nothing
to appear in my report rather than this error. Is there a way in a query or
report to make this happen?

Thanks,
 
In the query, your calculation would be something like the following

IIF(WeeklyTarget=0,Null,WeeklyRevenue/WeeklyTarget) as PercToTarget
 
Back
Top