Connecting Tech Pros Worldwide Help | Site Map

Suppressin DIV/0 in Access reports

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 02:31 PM
Mike
Guest
 
Posts: n/a
Default Suppressin DIV/0 in Access reports

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

  #2  
Old November 12th, 2005, 02:32 PM
Rick Brandt
Guest
 
Posts: n/a
Default Re: Suppressin DIV/0 in Access reports

"Mike" <mike_kenyon@tiscali.co.uk> wrote in message
news:732403d0.0310200905.5ae6638d@posting.google.c om...[color=blue]
> 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.[/color]

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


  #3  
Old November 12th, 2005, 02:32 PM
Peter Miller
Guest
 
Posts: n/a
Default Re: Suppressin DIV/0 in Access reports


Rick,

On Mon, 20 Oct 2003 12:35:26 -0500, "Rick Brandt"
<rickbrandt2@hotmail.com> wrote in comp.databases.ms-access:
[color=blue][color=green]
>> 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.[/color]
>
>IIf(field2=0, 0, field1/field2)[/color]

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
  #4  
Old November 12th, 2005, 02:33 PM
Mike
Guest
 
Posts: n/a
Default Re: Suppressin DIV/0 in Access reports

Thanks a lot guys - your solutions worked!


Peter Miller <pmiller@pksolutions.com> wrote in message news:<ul78pvkneh3g7qrmucarfb10bhggq7o4qt@4ax.com>. ..[color=blue]
> Rick,
>
> On Mon, 20 Oct 2003 12:35:26 -0500, "Rick Brandt"
> <rickbrandt2@hotmail.com> wrote in comp.databases.ms-access:
>[color=green][color=darkred]
> >> 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.[/color]
> >
> >IIf(field2=0, 0, field1/field2)[/color]
>
> 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[/color]
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.