Solved

#Div/0! in query field

Posted on 2014-12-22
3
90 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 119

Accepted Solution

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

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now