Solved

#Div/0! in query field

Posted on 2014-12-22
3
102 Views
Last Modified: 2014-12-22
I'm getting #Div/0! in a query field result using:

SchedLBHR: [tblLoadingSchedule.TotalWeight]/[ConvertedSchedHrs]

I tried:

SchedLBHR: [tblLoadingSchedule.TotalWeight]/Nz([ConvertedSchedHrs],0)

But that didn't work.
0
Comment
Question by:SteveL13
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 40513016
SchedLBHR:IIF(Nz([ConvertedSchedHrs],0)=0,0, [tblLoadingSchedule.TotalWeight]/[ConvertedSchedHrs])
0
 
LVL 36

Expert Comment

by:PatHartman
ID: 40513036
The point is that you cannot divide by zero so using Nz(), although it will change null to zero isn't a complete solution.  Rey's example shows how to return a 0 when the divisor is zero
0
 

Author Closing Comment

by:SteveL13
ID: 40513037
That did it.  Thanks.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

685 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