Solved

division by zero when export in Adobe

Posted on 2009-05-11
3
399 Views
Last Modified: 2012-05-06
I have a report where I want to see the percentage of the amt that insurance company paid on the total amt charged.
I originally entered this formula but got a DIVISION BY ZERO error when exporting into Adobe.
 ccur({Archrg99.Ins_Paid}) % ccur({Archrg99.Chrg_Amt})

So, I tried to alter the appointment by entering  this formula but still get the error.
if {Archrg99.Ins_Paid} = "0"
then
0
else
(ccur({Archrg99.Ins_Paid}) % ccur({Archrg99.Chrg_Amt}))

The problem is that some insurance companies have not paid yet so the INS_PAID amount may be zero.  When I check the formula (either one) it says there are no errors and the report runs.  I only get the error when exporting in Adobe.

Can you help.
Kate Rogers
0
Comment
Question by:kvrogers
  • 2
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 24358771
Why are you checking the Ins_Pais amount.  You need to check the Chrg_Amt since that is the field you are dividing by.

mlmcc
0
 
LVL 34

Accepted Solution

by:
James0628 earned 500 total points
ID: 24360570
Basically, what mlmcc said.  It's fine (mathematically) if Ins_Paid is 0.  That will just give you a 0 result.  If you're getting a "divide by 0" error, Chrg_Amt must be 0 (Or possibly null?) in some records, and that's the field you need to check.  If Chrg_Amt could ever be null, revise your formula to:

if IsNull ({Archrg99.Chrg_Amt}) or {Archrg99.Chrg_Amt} = "0"
then
0
else
(ccur({Archrg99.Ins_Paid}) % ccur({Archrg99.Chrg_Amt}))


 If Chrg_Amt won't be null, you can leave out the IsNull test.

 I assume from your test for = "0" (with quotes) that these fields are strings.  Obviously testing for "0" will only match that exact string.  If a zero could be represented in other ways ("00", "0.00", etc.), then you'd need to alter that test accordingly.  Likewise, if the fields could ever be something other than a number, you should test for that too.

 James
0
 
LVL 34

Expert Comment

by:James0628
ID: 24502204
To be fair, if the problem was that you were checking Ins_Paid for 0 instead of Chrg_Amt, mlmcc probably deserves most of the credit (and points) for pointing that out first.

 James
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question