Dealing with NULL values - NZ function

  • Thread starter Thread starter Joe Williams
  • Start date Start date
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
 
You probably need to use the function on the field being summed:

Sum(NZ(LaborHours,0)
 
Back
Top