IFF FUNCTION

IFF FUNCTION

am 07.04.2008 21:52:25 von Shiller

Experts,

Can you have "Or" allowed in the expression of a IFF Function?

The following function works perfectly:

IIf([Alphabet]="A",0,1)

But I can't get it to work with "Or":

IIf(([Alphabet]="A") Or ([Alphabet]="B") Or ([Alphabet]="C"),0,1)

Re: IFF FUNCTION

am 07.04.2008 22:01:53 von Ascerbus

Try this:

IIf([Alphabet]="A","A is true", IIf([Alphabet]="B", "B is true",
IIf([Alphabet]="C", "C is true", "A, B, C is not true")))

Basically you can embed another IIf statement in your "False"
parameter in the conditional statement.

Re: IFF FUNCTION

am 07.04.2008 22:04:26 von Guillermo_Lopez

On Apr 7, 3:52=A0pm, Shiller wrote:
> Experts,
>
> Can you have "Or" allowed in the expression of a IFF Function?
>
> The following function works perfectly:
>
> =A0IIf([Alphabet]=3D"A",0,1)
>
> But I can't get it to work with "Or":
>
> =A0IIf(([Alphabet]=3D"A") Or ([Alphabet]=3D"B") Or ([Alphabet]=3D"C"),0,1)=


I doubt you can use Or in either IFF or IIF, Since IFF doesn't exist
and Or is not used like that.

Try this

IIF([Alphabet]=3D"A",0,IIF([Alphabet]=3D"A",0,IIF([Alphabet] =3D"A",0,1)))

or you can create your one function IFF that allows this and the ORs.

-GL

Re: IFF FUNCTION

am 07.04.2008 22:36:11 von Lyle Fairfield

Shiller wrote in news:9c4d82b1-e8ae-4018-bfef-
30a114b9d711@n58g2000hsf.googlegroups.com:

> Experts,
>
> Can you have "Or" allowed in the expression of a IFF Function?
>
> The following function works perfectly:
>
> IIf([Alphabet]="A",0,1)
>
> But I can't get it to work with "Or":
>
> IIf(([Alphabet]="A") Or ([Alphabet]="B") Or ([Alphabet]="C"),0,1)

It works here in Canader.
Perhaps there is something unusual about Alphabet?

Have you considered?

IIF([Alphabet] In ("A","B","C"),0,1)

or

-(CInt([Alphabet] In ("A","B","C")))

oops

-(CInt(Not [Alphabet] In ("A","B","C")))

Re: IFF FUNCTION

am 07.04.2008 23:28:26 von u28780

IIf(([Alphabet]="A") Or ([Alphabet]="B") Or ([Alphabet]="C"),0,1)

works just fine for me! Exactly how are you using it?

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-ac cess/200804/1

Re: IFF FUNCTION

am 07.04.2008 23:36:02 von Shiller

On Apr 7, 4:36 pm, lyle fairfield wrote:
> Shiller wrote in news:9c4d82b1-e8ae-4018-bfef-
> 30a114b9d...@n58g2000hsf.googlegroups.com:
>
> > Experts,
>
> > Can you have "Or" allowed in the expression of a IFF Function?
>
> > The following function works perfectly:
>
> > IIf([Alphabet]="A",0,1)
>
> > But I can't get it to work with "Or":
>
> > IIf(([Alphabet]="A") Or ([Alphabet]="B") Or ([Alphabet]="C"),0,1)
>
> It works here in Canader.
> Perhaps there is something unusual about Alphabet?
>
> Have you considered?
>
> IIF([Alphabet] In ("A","B","C"),0,1)
>
> or
>
> -(CInt([Alphabet] In ("A","B","C")))
>
> oops
>
> -(CInt(Not [Alphabet] In ("A","B","C")))

Lyle suggestion works fine:

IIF([Alphabet] In ("A","B","C"),0,1)

Thanks,