AND OR operator won't work

G

graatje

With a mail merge I want to check if the fields "company" and "name" are
filled (not empty)if this is true then the text "attn. " has to be placed
before the name. Somehow it won't work, does anybody know why?

{COMPARE{MERGEFIELD company} <>""}

{COMPARE{MERGEFIELD name}<>""}

IF{=AND({COMPARE{MERGEFIELD company} <>""},{COMPARE{MERGEFIELD
name}<>""})}=1 "true" "false"}

Here the result of some fields:

0

1

false


1

1

false



The first two comparisions went well, the AND function doesn't seem to work,
whatever I change it remains "false", even if I replace AND with OR. Please
help.
 
G

Graham Mayor

Try
{ IF{ mergefield name } <> "" "{ IF{ mergefield company } <> "" "attn."
"" }" "" }

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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