Nested IIF with AND and Multiple Conditions

  • Thread starter Paperback Writer
  • Start date
P

Paperback Writer

Is it possible to use an "AND" with a nested IIF?

Here is my syntax, which isn't working. PLEASE HELP!!!

IIF(AND([Value One]>0,
Code:
="Delivery"),[Total Value Two]-[Value
Three],IIF(AND([Value Four]>0,[Code]="Reserve"),[Value Five]-[Value Six],0))
 
D

Dirk Goldgar

Paperback Writer said:
Is it possible to use an "AND" with a nested IIF?

Here is my syntax, which isn't working. PLEASE HELP!!!

IIF(AND([Value One]>0,
Code:
="Delivery"),[Total Value Two]-[Value
Three],IIF(AND([Value Four]>0,[Code]="Reserve"),[Value Five]-[Value
Six],0))[/QUOTE]


You can use in an IIf expression, though not the way you've tried, but I
can't figure out from your attempt what the actual logical expression is
that you want to evaluate.  Could you state it in simple words, please?
 
P

Paperback Writer

I'd rather not say.

Is it not possible to create something from my formula? Could you
demonstrate a nested IIF / AND / Multiple Conditions expression that works?


Dirk Goldgar said:
Paperback Writer said:
Is it possible to use an "AND" with a nested IIF?

Here is my syntax, which isn't working. PLEASE HELP!!!

IIF(AND([Value One]>0,
Code:
="Delivery"),[Total Value Two]-[Value
Three],IIF(AND([Value Four]>0,[Code]="Reserve"),[Value Five]-[Value
Six],0))[/QUOTE]


You can use in an IIf expression, though not the way you've tried, but I
can't figure out from your attempt what the actual logical expression is
that you want to evaluate.  Could you state it in simple words, please?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
[/QUOTE]
 
J

John Spencer (MVP)

More like the following:

IIF([Value One]>0 AND
Code:
="Delivery",[Total Value Two]-[Value Three]
,IIF([Value Four]>0 AND [Code]="Reserve"),[Value Five]-[Value Six],0))



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

Dirk Goldgar

Paperback Writer said:
I'd rather not say.

I didn't mean you needed to get down to specifics with the actual field
names; just explain the logic you wanted to implement.
Is it not possible to create something from my formula? Could you
demonstrate a nested IIF / AND / Multiple Conditions expression that
works?

See John Spencer's reply. Maybe he figured out correctly what you had in
mind.
 
K

KARL DEWEY

If will not give more explaination no one can help you because your formula
does not make any sense.
What two sets of conditions are you saying must be met with your AND?

Maybe you meant something like this --
CODE: IIF([Value One]>0 AND [Total Value Two]-[Value Three],
"Delivery", IIF([Value Four]>0 AND Value Five]-[Value Six], "Reserve"),"0"))

--
KARL DEWEY
Build a little - Test a little


Paperback Writer said:
I'd rather not say.

Is it not possible to create something from my formula? Could you
demonstrate a nested IIF / AND / Multiple Conditions expression that works?


Dirk Goldgar said:
Paperback Writer said:
Is it possible to use an "AND" with a nested IIF?

Here is my syntax, which isn't working. PLEASE HELP!!!

IIF(AND([Value One]>0,
Code:
="Delivery"),[Total Value Two]-[Value
Three],IIF(AND([Value Four]>0,[Code]="Reserve"),[Value Five]-[Value
Six],0))[/QUOTE]


You can use in an IIf expression, though not the way you've tried, but I
can't figure out from your attempt what the actual logical expression is
that you want to evaluate.  Could you state it in simple words, please?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
[/QUOTE][/QUOTE]
 
P

Paperback Writer

THANK YOU

John Spencer (MVP) said:
More like the following:

IIF([Value One]>0 AND
Code:
="Delivery",[Total Value Two]-[Value Three]
,IIF([Value Four]>0 AND [Code]="Reserve"),[Value Five]-[Value Six],0))



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

[QUOTE="Paperback"]
Is it possible to use an "AND" with a nested IIF?

Here is my syntax, which isn't working.  PLEASE HELP!!!

IIF(AND([Value One]>0,[Code]="Delivery"),[Total Value Two]-[Value
Three],IIF(AND([Value Four]>0,[Code]="Reserve"),[Value Five]-[Value Six],0))[/QUOTE]
[/QUOTE]
 

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