UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> #Div/0!    
 
   
kakluvs2sk8
post Jun 2 2008, 01:27 PM
Post #1

UtterAccess Enthusiast
Posts: 79



Hi,
I have created a calculation in a report. There are some records which are dividing by zero. Since division by zero is impossible, it is returning #Div/0! for those records. Is there a way I can make those records show with nothing in the report (Instead of #Div/0!). I thought I might be able to do conditional formatting, but I have not had luck with it.

Thanks,
Kelly
Go to the top of the page
 
+
theDBguy
post Jun 2 2008, 01:30 PM
Post #2

Access Wiki and Forums Moderator
Posts: 48,057
From: SoCal, USA



It would help to see your code, but should be something like this:

=IIf([Field1]=0, 0, [Field2]/IIf([Field1]=0,1,[Field1]))

(untested)
Hope that helps...
Go to the top of the page
 
+
kakluvs2sk8
post Jun 2 2008, 01:43 PM
Post #3

UtterAccess Enthusiast
Posts: 79



Here is my calculation:
=([Total Of Billed PM]/([SumOfTotal EFM]/[Duration]))/[Project Months]

Where project months can be zero (thus creating the #Div/0). Can I add an if statement to this calculation?
Go to the top of the page
 
+
doctor9
post Jun 2 2008, 01:51 PM
Post #4

UtterAccess VIP
Posts: 9,300
From: Wisconsin



Yes, just substitute the [Project Months] bit in the IF test, and your formula in the FALSE section of the test.

=Iif([Project Months]=0,0,([Total Of Billed PM]/([SumOfTotal EFM]/[Duration]))/[Project Months])

Basically, this says, "If the Project Months field is zero, then just display a zero. Otherwise, display the result of a calculation."

Hope this helps,

Dennis
Go to the top of the page
 
+
kakluvs2sk8
post Jun 2 2008, 02:08 PM
Post #5

UtterAccess Enthusiast
Posts: 79



Wow that worked like a charm! Thanks bunches!
Go to the top of the page
 
+
theDBguy
post Jun 2 2008, 02:39 PM
Post #6

Access Wiki and Forums Moderator
Posts: 48,057
From: SoCal, USA



You're welcome. Dennis and I are happy to help. Good luck with your project.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 23rd May 2013 - 05:03 PM