Dealing with NULL values - NZ function

J

Joe Williams

I have two queries - one that totals up labor hours by job number and
another that then uses these totals in calculations.

The problem I am having is that if there were no hours for a particular job
in the subquery, then the value for that total field is NULL. thus any
calculations I use result in an #ERROR

I tried dealing with this in the second query by creating an alias of the
total field like this: NewTotal = NZ(OldTotal) and then using NewTotal in my
calcations. But NewTotal still returns NULL even though I am using the NZ
function to try and get rid of it.

Any thoughts on how to deal with the NULL value and make my calcuations work
in the top level query? Am I using the NZ function incorrectly? Thanks

- Joe
 
L

Lynn Trapp

You probably need to use the function on the field being summed:

Sum(NZ(LaborHours,0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top