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 / July 2006

Tip: Looking for answers? Try searching our database.

#Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LJG - 30 Jul 2006 21:16 GMT
Hi Guys,

Any suggestions why I am getting the #error with this

Margin: Nz([gp],0)/Nz([discount1],0)/100

This happens if the field discount has a value of 0
fredg - 30 Jul 2006 21:44 GMT
> Hi Guys,
>
[quoted text clipped - 3 lines]
>
> This happens if the field discount has a value of 0

In math, what is the result of Zero divided by 3?
Zero.

What is the result of 3 divided by zero?

You cannot divide a number by 0, so you received an error when
[discount1] is null ...  Nz([Discount1],0).

Test for 0 before doing the calculation.

Margin:IIf(Nz([Discount1],0) = 0 , Null,Nz([gp],0)/[Discount1]/100)

You'll get 0 if [gp] is null and [Discount1] has a value, an empty
field (Null) if [Discount1] is null, or the result of
[gp]/[Discount1]/100 if both fields have a value other than zero.
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
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.