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]))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Query Expression 3
Access Query problem 1
Access #Error & Excel Pivot 0
Access My Expression Contains Wrong number of arguments 0
Syntax Error 4
Access Can't Get Dlookup To Work 1
Access Switchboard error message 1
Update Query 2

Back
Top