A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Corrected divide by zero errors, now no formatting of numbers



 
 
Thread Tools Display Modes
  #1  
Old July 18th, 2008, 09:40 PM posted to microsoft.public.access.queries
kahaymon
external usenet poster
 
Posts: 8
Default Corrected divide by zero errors, now no formatting of numbers

I used the info in this help article:
http://office.microsoft.com/en-us/ac...CL100570041033
to correct divide by zero errors, and now the properties dialog box for that
field does not allow me to set the decimal places at all. Is there a work
around?

Thanks.
  #2  
Old July 19th, 2008, 05:07 AM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default Corrected divide by zero errors, now no formatting of numbers

"kahaymon" wrote in message
...
I used the info in this help article:
http://office.microsoft.com/en-us/ac...CL100570041033
to correct divide by zero errors, and now the properties dialog box for
that
field does not allow me to set the decimal places at all.


That article gives really bad advice, that will create the problem you
experienced.

Step 4 of the last section suggests setting the Control Source ot:
=IIf([Divisor]=0,"",[Dividend]/[Divisor])
It should be:
=IIf([Divisor]=0, Null, [Dividend]/[Divisor])

The zero-length-string option means that Access treats the results as text,
i.e. non-numeric. That's why you could not apply a numeric format.

Technically, division by zero is 'undefined', which is perfectly represented
as Null. (As a practial example, any averaging of the resultset will be
correct if you use Null, because the undefined result should now skew the
average.)

I will attempt to get the article changed for you.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.