IfThenElse in a mailmerge

A

Alex Hammerstein

Hi, I am trying to create an ITE in my mailmerge.

I have two fields: Title and Gender.

I am trying to create an ITE statement which effectively says: If Title is
Blank and gender = male then Mr, else if Title is Blank and gender = Female
then Ms, else Title.

I don't seem to be able to get it right. Can someone help please

Tks

A
 
P

Peter Jamieson

Something like

{ IF "{ MERGEFIELD Title }" = ""
"{ IF "{ MERGEFIELD gender \*Upper }" = "MALE"
"Mr"
"{ IF "{ MERGEFIELD gender \*Upper }" = "FEMALE"
"Ms"
"(if you need something special when title is blank and it's neither
male nor female, put it here)" }" "{ MERGEFIELD Title }" }

where all the pairs of {} are the special field braces you can insert
using ctrl-F9, and all the above can be on one line if you like.

Peter Jamieson

http://tips.pjmsn.me.uk
 
M

macropod

Hi Alex,

A slightly simpler code:
{IF{MERGEFIELD Title}<> "" {MERGEFIELD Title} {IF{MERGEFIELD Gender \* Caps}= "M*" Mr Ms}}
Note: this doesn't provide for a default output if both the title and gender are empty.
 
A

Alex Hammerstein

Thanks Peter

Alex


Something like

{ IF "{ MERGEFIELD Title }" = ""
"{ IF "{ MERGEFIELD gender \*Upper }" = "MALE"
"Mr"
"{ IF "{ MERGEFIELD gender \*Upper }" = "FEMALE"
"Ms"
"(if you need something special when title is blank and it's neither
male nor female, put it here)" }" "{ MERGEFIELD Title }" }

where all the pairs of {} are the special field braces you can insert
using ctrl-F9, and all the above can be on one line if you like.

Peter Jamieson

http://tips.pjmsn.me.uk
 

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