473,394 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

#num! error type

I have created a database in MS Access 2000. I want to compute for
percent defective and in the control source I have this expression:
=(([no_defective]/[no_made])*100). Its OK if I have the numbers
greater than zero. But when I get a zero value on both fields I get
the #num! error value. I need help on how I can return a value to
zero when I get the #num!error value. Please help, I'm very desperate.
Nov 12 '05 #1
1 6017
<fr********@aol.com> wrote in message
news:40**************************@posting.google.c om...
I have created a database in MS Access 2000. I want to compute for
percent defective and in the control source I have this expression:
=(([no_defective]/[no_made])*100). Its OK if I have the numbers
greater than zero. But when I get a zero value on both fields I get
the #num! error value. I need help on how I can return a value to
zero when I get the #num!error value. Please help, I'm very desperate.


In fact the problem is caused when no_made is zero. The field no_defective
could be a positive number and the error would still occur. The problem is
you can't divide by zero, so you need to catch this case with, for example:

IIf([no_made]>0,([no_defective]/[no_made])*100,Null)

Additionally, if your database allows for null values, you might like to
catch the case when say 25 have been made, and there is a null value in the
[no_defective] field:

IIf([no_made]>0,(Nz([no_defective],0)/[no_made])*100,Null)
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Francis Bell | last post by:
Hello, I've got a program that is reading in a data file of 25 lines. Here is an example of the first two lines: sp/spinnerbait/AAA Lures/Mad Phil/silver/bass/1/1 f/floating minnow/AAA...
4
by: Kerry | last post by:
Let's say I have float num = 1.1 and have float increment = 0.1 , num +=increment doesn't compute exactly to 1.2 ... is there a way to make it equal exactly to 1.2?
1
by: Paul Nathan | last post by:
Further to my post about keyboard problems, I have discovered that Num Lock seems to change the e.keycode for the arrow keys and the 9 above them excluding scroll lock and pause-break. With Num...
1
by: mazdotnet | last post by:
Hi, In excel there is a function MROUND(num, multiple) - The num argument is the number you want to round, while multiple is the value you want used in the rounding. Is there a function in C#...
2
by: FBergemann | last post by:
if i compile following sample: #include <iostream> #include <string> int main(int argc, char **argv) { std::string test = "hallo9811111z"; std::string::size_type ret;
35
by: fermineutron | last post by:
For a while now i have been "playing" with a little C program to compute the factorial of large numbers. Currently it takes aboy 1 second per 1000 multiplications, that is 25000P1000 will take...
7
by: southernsunsations | last post by:
/******************************************************************\ * * * * Date: 09.06.2007 ...
11
by: Xaysana12345 | last post by:
Hi there, I am having problem with form and report calculation fields showing #Num. ex. fieldA/fieldB if either fieldA or B=null, in the result field obtains #Num. How can I figure out? ...
9
ollyb303
by: ollyb303 | last post by:
Hi, I have created a report in my Access db which has two columns - I'll call them Number1 and Number2. I have added a textbox to calculate a percentage from these two numbers =(/) with the...
2
kcdoell
by: kcdoell | last post by:
Hello: I have three unbound text boxes in which I have the following calculations in the control source of each box: FCST Total; =Nz(DSum("","ReQryForecast"," >= 75"),0) Budget Total; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.