Solved

#Div/0! in query field

Posted on 2014-12-22
3
99 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 35

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

810 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