Suppress # Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I remove the # Error in the fields when there is no data?
I have a query that divides pallets per number of hour spent in different
functions.
If I use the function Nz() it works but the field where I am supposed to
have the total hours (of all fields null and non null) then doesn't show
anything. When I have the field with the #error message it does show a total
which I would like to see
 
You can't until you get the formula to return correctly.
You may be able to return a 0 rather than null using an immediate if
statement in a query, which you need the NZ so your formula will evaluate.

An alternative is place the NZ function around your Total hours field in
addition to the other field.

IIF(fieldname is null, 0,[fieldname]). This will return a zero if the field
is null, otherwise it returns the value of the field.
 
Thanks for your prompt answer.
The query has a field called Inbound: Nz([Inbound pallets]/[Inbound
hours],0) and a field called Outbound: Nz([Outbound pallets]/[Outbound
hours],0). In the same query I have a field called Total Hours Nz([Inbound]
+[Outbound],0). Each field in the source table of the query has a default of
0. Is it where the problem is?
Where do I place the Iif statement?
I am sorry about all the questions
--
Thanks
stephanie


G. Vaught said:
You can't until you get the formula to return correctly.
You may be able to return a 0 rather than null using an immediate if
statement in a query, which you need the NZ so your formula will evaluate.

An alternative is place the NZ function around your Total hours field in
addition to the other field.

IIF(fieldname is null, 0,[fieldname]). This will return a zero if the field
is null, otherwise it returns the value of the field.
 

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