#Error in Query

  • Thread starter mattc66 via AccessMonster.com
  • Start date
M

mattc66 via AccessMonster.com

I have the following in my query and it keeps returning a #Error. Can anyone
tell me what I am doing wrong?

IIf(IsError([MoCalc]/[YTD_QTY_SOLD]),0,[MoCalc]/[YTD_QTY_SOLD])



Matt
 
A

ANDY-N via AccessMonster.com

#Error = division by zero, one of the fields you dividing contains a zero.
You could use iif([MoCalc] = 0 or [YTD_QTY_SOLD] = 0,0,[MoCalc]/[YTD_QTY_SOLD]
)
I have the following in my query and it keeps returning a #Error. Can anyone
tell me what I am doing wrong?

IIf(IsError([MoCalc]/[YTD_QTY_SOLD]),0,[MoCalc]/[YTD_QTY_SOLD])

Matt
 
Top