General discussion

Locked

Access and Division Expression

By richard.safford ·
I am having a problem with Dividing by zero errors within a Query. The database has to have default values of 0 because this database application needs to generate negitve number variances. I am currently getting a #Error message within the querry field. But any field with positive or negative numbers is generating the correct number.

The expression is
1 This is the definition:
(([Table_orQuery])![Table_name_1]/[Table_or_Query]![Table_Name_2]))

Can anyone please give me some insite.
Thanks

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Division in Access

by goodmanr In reply to Access and Division Expre ...

You need to use the "immediate if" statement in order to test for the 0 value. The format is:
iif([Divideby_Field_name]=0,true expression,([Table_orQuery])![Table_name_1]/[Table_or_Query]![Table_Name_2])

Collapse -

Hope This Helps

by sjbement In reply to Access and Division Expre ...

Expr1: IIf([Tbl]![Denominator]=0,"N/A",[Tbl]![Numerator]/[Tbl]![Denominator])

Semper Fi,
Red

Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums