By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,045 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,045 IT Pros & Developers. It's quick & easy.

Suppressin DIV/0 in Access reports

P: n/a
Hi,

I have an Access report which has two fields from a database on it. I
have a third field which is just a textbox that divides one by
another. My question/problem is that if the dividing field is 0 then
I get a DIV/0 in my report.

Ideally I would like it to say if field3 is div/0 then print 0.

Any ideas/work arounds would be greatly appreciated.

Regards
Mike
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Mike" <mi*********@tiscali.co.uk> wrote in message
news:73**************************@posting.google.c om...
Hi,

I have an Access report which has two fields from a database on it. I
have a third field which is just a textbox that divides one by
another. My question/problem is that if the dividing field is 0 then
I get a DIV/0 in my report.

Ideally I would like it to say if field3 is div/0 then print 0.


IIf(field2=0, 0, field1/field2)
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #2

P: n/a

Rick,

On Mon, 20 Oct 2003 12:35:26 -0500, "Rick Brandt"
<ri*********@hotmail.com> wrote in comp.databases.ms-access:
I have an Access report which has two fields from a database on it. I
have a third field which is just a textbox that divides one by
another. My question/problem is that if the dividing field is 0 then
I get a DIV/0 in my report.

Ideally I would like it to say if field3 is div/0 then print 0.


IIf(field2=0, 0, field1/field2)


That certainly answers the original question, but isn't the original
question suspect? Why does the OP want 0 to represent both 0/N and
0/0? In general, one should really be distinguishing between 0/0 and
0, or more specifically, the formula should be something like:

IIf(field2=0, 'n/a', field1/field2)

or, at least

IIf(field2=0, null, field1/field2)

Peter Miller
__________________________________________________ __________
PK Solutions -- Data Recovery for Microsoft Access/Jet/SQL
Free quotes, Guaranteed lowest prices and best results
www.pksolutions.com 1.866.FILE.FIX 1.760.476.9051
Nov 12 '05 #3

P: n/a
Thanks a lot guys - your solutions worked!
Peter Miller <pm*****@pksolutions.com> wrote in message news:<ul********************************@4ax.com>. ..
Rick,

On Mon, 20 Oct 2003 12:35:26 -0500, "Rick Brandt"
<ri*********@hotmail.com> wrote in comp.databases.ms-access:
I have an Access report which has two fields from a database on it. I
have a third field which is just a textbox that divides one by
another. My question/problem is that if the dividing field is 0 then
I get a DIV/0 in my report.

Ideally I would like it to say if field3 is div/0 then print 0.


IIf(field2=0, 0, field1/field2)


That certainly answers the original question, but isn't the original
question suspect? Why does the OP want 0 to represent both 0/N and
0/0? In general, one should really be distinguishing between 0/0 and
0, or more specifically, the formula should be something like:

IIf(field2=0, 'n/a', field1/field2)

or, at least

IIf(field2=0, null, field1/field2)

Peter Miller
__________________________________________________ __________
PK Solutions -- Data Recovery for Microsoft Access/Jet/SQL
Free quotes, Guaranteed lowest prices and best results
www.pksolutions.com 1.866.FILE.FIX 1.760.476.9051

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.