Expression Error

  • Thread starter Thread starter ladybug via AccessMonster.com
  • Start date Start date
L

ladybug via AccessMonster.com

I have this expression in a query: [CleanOrdersWithin]/([TotalShippedOrders]-
[OrdersReqIntervention])
If CleanOrders Within and Total Shipped Orders both = 0, how do I get the
expression to not error?
 
Hi

To avoid a divide by zero error you only need to check if the divisor is zero.
i.e. [TotalShippedOrders]-[OrdersReqIntervention]

So I would use...

iif([TotalShippedOrders]-[OrdersReqIntervention]=0, 0, [CleanOrdersWithin] /
([TotalShippedOrders] - [OrdersReqIntervention]))


Regards

Andy Hull
 
hi,
I have this expression in a query: [CleanOrdersWithin]/([TotalShippedOrders]-
[OrdersReqIntervention])
If CleanOrders Within and Total Shipped Orders both = 0, how do I get the
expression to not error?
Use

Iif([TSO]-[ORI]=0; -1; [TSO]-[ORI])

as denominator.



mfG
--> stefan <--
 
ladybug said:
I have this expression in a query: [CleanOrdersWithin]/([TotalShippedOrders]-
[OrdersReqIntervention])
If CleanOrders Within and Total Shipped Orders both = 0, how do I get the
expression to not error?


IIf([TotalShippedOrders] - [OrdersReqIntervention] = 0, 0,
[CleanOrdersWithin] / ([TotalShippedOrders] -
[OrdersReqIntervention]))
 
Back
Top