Multiple "or" in "If Statement"

W

WordUser

Would appreciate proper syntax for the following "If Statement":

{IF {MERGEFIELD AlphaCode} = "A" or "B" or "C" or "D" or "E"
"TRUE" "FALSE"}

Thanks
 
J

JudithJubilee

Hello there,

Try this:

{IF {MERGEFIELD AlphaCode} = "A" "True" {IF {MERGEFIELD
AlphaCode} = "B" "True" {IF {MERGEFIELD AlphaCode}
= "C" "True" {IF {MERGEFIELD AlphaCode} = "D" "True" {IF
{MERGEFIELD AlphaCode} = "E" "True" "False" }}}}}

Hope this helps

Judith
 
P

Peter Jamieson

Unfortunately you can't do it that way round.

There are several ways you could try this, e.g.

{ IF { MERGEFIELD AlphaCode } = "A"
"TRUE"
"{ IF { MERGEFIELD Alphacode } = "B"
"TRUE" "FALSE" }" }

but extended to C, D and E, or

{ IF { ={ COMPARE { MERGEFIELD AlphaCode } = "A" }+{ COMPARE { MERGEFIELD
AlphaCode } = "B" }+{ COMPARE { MERGEFIELD AlphaCode } = "C" } } > 0 "TRUE"
"FALSE" }

also extended to D and E.

Peter Jamieson
 

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