Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Surpass Division by Zero??? 1

Status
Not open for further replies.

RookieDBO

Technical User
Sep 20, 2001
83
CA
I need help on getting around the "Division by Zero" message in Access. My expression is the following.

Week OH: IIf([x14-Pure Outstanding List with Last Week Invn & Fcst]![This Week Invn]>[x14-Pure Outstanding List with Last Week Invn & Fcst]![SumOfSumOfCURR_FCST_QTY],[x14-Pure Outstanding List with Last Week Invn & Fcst]![This Week Invn]/[x14-Pure Outstanding List with Last Week Invn & Fcst]![SumOfSumOfCURR_FCST_QTY],0)

The above still shows me the error message. And if I wanted to show a text value instead of a zero, how would I do it?

Thanks,
RookieDBO
 
Boy, this might make it a lot bigger but my first thought would be that you could throw another IIF in there to check if the value of [x14-Pure Outstanding List with Last Week Invn & Fcst]![SumOfSumOfCURR_FCST_QTY] is = 0 and if it is then return the text you want, other wise carry on with your second immediate if.....


Week OH: IIf([x14-Pure Outstanding List with Last Week Invn & Fcst]![SumOfSumOfCURR_FCST_QTY] = 0,"TextHere",IIf([x14-Pure Outstanding List with Last Week Invn & Fcst]![This Week Invn]>[x14-Pure Outstanding List with Last Week Invn & Fcst]![SumOfSumOfCURR_FCST_QTY],[x14-Pure Outstanding List with Last Week Invn & Fcst]![This Week Invn]/[x14-Pure Outstanding List with Last Week Invn & Fcst]![SumOfSumOfCURR_FCST_QTY],0))


I think that would work for what you are asking
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top