IIF function help...

C

Cam

Hello,

I have the following formula in Excel that caculate the setup time and I am
trying to replicate in Access query and have no success so far. Any help is
appreciated.

SetupTime = If(Rate * Qty/line * (Percent/20) * OrdInt < MinQty, Rate *
Qty/Line * (Percent/20) * 20/MinQty, If(Rate * Qty/Line * (Percent/20) *
OrdInt > MaxQty, Rate * Qty/Line * (Percent/20) * (20/MaxQty), (20/OrdInt))

If Description would be like this:
If formula "Rate * Qty/line * (Percent/20) * OrdInt " is Less than MinQty,
then use formula "Rate * Qty/Line * (Percent/20) * 20/MinQty" If formula
"Rate * Qty/line * (Percent/20) * OrdInt " > MaxQty, use formula "Rate *
Qty/Line * (Percent/20) * (20/MaxQty)" else use (20/OrdInt).
 
J

John Spencer

Use an immediate if (IIF) in expression

IIF(Rate * Qty/line * (Percent/20) * OrdInt < MinQty
, Rate * Qty/Line * (Percent/20) * 20/MinQty
, IIf(Rate * Qty/Line * (Percent/20) * OrdInt > MaxQty
, Rate * Qty/Line * (Percent/20) * (20/MaxQty)
, (20/OrdInt))

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

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

Top