Home |
Search |
Today's Posts |
#1
|
|||
|
|||
AND OR operator won't work
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. |
#2
|
|||
|
|||
Try
{ IF{ mergefield name } "" "{ IF{ mergefield company } "" "attn." "" }" "" } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org graatje wrote: 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. |