Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / May 2005

Tip: Looking for answers? Try searching our database.

Eliminating #Div/0! Errors

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ChuckW - 18 May 2005 21:53 GMT
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,
Signature

Chuck W

David Lloyd - 18 May 2005 22:55 GMT
Chuck:

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

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

Signature

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,
Signature

Chuck W

John Spencer (MVP) - 19 May 2005 01:02 GMT
In the query, your calculation would be something like the following

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

> Hi,
>
[quoted text clipped - 9 lines]
> --
> Chuck W
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.