Query - Adding

  • Thread starter Thread starter Pass-the-reality
  • Start date Start date
P

Pass-the-reality

I have a field [Claims] and a field [Executed] In my query I want to divide
the two so I created
ExecutedPercent:Format([Claims]/[Executed],"Percent") My problem is if data
in claims is blank and the data in executed blank, my ExecutedPercent is
blank. How can my ExecutedPercent to show zero?
 
ExecutedPercent:Format(Nz([Claims],0)/Nz([Executed],1),"Percent")

The Nz function will return the value of the second argument if the value of
the first argument is Null. In this case, you want to convert Claims to 0,
but if you convert Executed to 0 and it had a Null value, you would get a
divide by zero error. Converting it to 1 will cause it to divide Claims by 1
which will return the value of Claims.
 

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

Back
Top