#Error

libby32

Registered User.
Local time
Today, 09:39
Joined
Mar 6, 2003
Messages
42
I have a pretty complicated calculation in my query. Sometimes I get a value returned sometimes I get #Error. How can I get rid of this??
 
# Error

This is the calculation in my Query. I usually use the nz function without the 0....Could this be my problem??

LgQty: (Nz([LgAllocation])*Nz([WtPerTub])/Nz([No_Lg_Containers])*Nz([LgfrWharf]))
 
It's in the maths, not the code.

Your use of Nz in the denominator suggests that this may sometimes resolve to zero. This means you will be dividing by zero, hence the error.
 
Sometimes the value will be zero, so how can I fix this equation??

Thanks...
 
If the demominator is zero, the fomula has no meaning. What do you want to show in this case?
 
Sometime there will be value in a field that a formula is based on, when there is, the formula works great...When the value in the field is 0, then there will be a division by 0 , then # Error shows up in my qery. I have a report based on this query, I don't want # Error to show up on my reoprt. How can I avoid this??
 
You have to answer the question in my last posting!

What do you want to show if the denominator is zero?
 
# Error

Sorry! I still want a 0 to show because I need this value in another calculation to get a total sum...
 
LgQty: IIF((Nz([No_Lg_Containers])*Nz([LgfrWharf]))=0,0, (Nz([LgAllocation])*Nz([WtPerTub])/Nz([No_Lg_Containers])*Nz([LgfrWharf]))

I think the parentheses are matched!
 

Users who are viewing this thread

Back
Top Bottom