# 6.1 crystal 8.5 division by zero

Thanks Paul,
I had an if statement for one field, but actually had another field
that was sometimes zero, and putting the if statement in it seems to
have fixed it.
Dennis

Paul V. Blais wrote:

> First you have to determine the field that is dividing by zero. Once
> you find it you have to use the bold portion of statement below.
>
> if {JobHead.QtyCompleted}=0 then 0 else
>
> {@Total Act. Cost}/{JobHead.QtyCompleted}
>
> In this example if we have 0 qty completed the expression should be 0
> but if it's not 0 the we are doing the calculation you see.
>
> It is an IF, THEN, ELSE statement.
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>] On
> Behalf
> Of Dennis Houghton
> Sent: Friday, March 09, 2007 10:35 AM
> To: vantage
> Subject: [Vantage] 6.1 crystal 8.5 division by zero
>
> I am trying to work around this error I get only in crystal, I don't get
>
> it in access or RB, seems some fields in my formula have no value and
> when I divide this field by another I get this dreaded crystal error
> (division by zero). Is there some kind of universal fix or workaround
> for this error?
> Can someone who's experienced this give me a little help?
> Thanks
> dennis
>
> [Non-text portions of this message have been removed]
>
>
I am trying to work around this error I get only in crystal, I don't get
it in access or RB, seems some fields in my formula have no value and
when I divide this field by another I get this dreaded crystal error
(division by zero). Is there some kind of universal fix or workaround
for this error?
Can someone who's experienced this give me a little help?
Thanks
dennis
First you have to determine the field that is dividing by zero. Once
you find it you have to use the bold portion of statement below.

if {JobHead.QtyCompleted}=0 then 0 else

{@Total Act. Cost}/{JobHead.QtyCompleted}

In this example if we have 0 qty completed the expression should be 0
but if it's not 0 the we are doing the calculation you see.

It is an IF, THEN, ELSE statement.

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Dennis Houghton
Sent: Friday, March 09, 2007 10:35 AM
To: vantage
Subject: [Vantage] 6.1 crystal 8.5 division by zero

I am trying to work around this error I get only in crystal, I don't get

it in access or RB, seems some fields in my formula have no value and
when I divide this field by another I get this dreaded crystal error
(division by zero). Is there some kind of universal fix or workaround
for this error?
Can someone who's experienced this give me a little help?
Thanks
dennis

[Non-text portions of this message have been removed]
Dennis,

Under File, Report Options select the "Convert Null field value to
default" and I believe this will solve your problem. If not create a
formula field such as

If isnull{FieldName}

Then 0

Else {FieldName}

And divide by your formula field.

Chris

_____

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Dennis Houghton
Sent: Friday, March 09, 2007 7:35 AM
To: vantage
Subject: [Vantage] 6.1 crystal 8.5 division by zero

I am trying to work around this error I get only in crystal, I don't get

it in access or RB, seems some fields in my formula have no value and
when I divide this field by another I get this dreaded crystal error
(division by zero). Is there some kind of universal fix or workaround
for this error?
Can someone who's experienced this give me a little help?
Thanks
dennis

[Non-text portions of this message have been removed]