Word "If-then-else" Field

M

Michelle Craig

Hi,

I'm trying to create a mail merge document that will display information for
a particular academic area based on three criteria that are in the data
source. One is degree (ADEG1), one is College (ACOL1) and one is Major Code
(MAJ1_CODE). I have been trying to nest the IF statements to look at all
three fields, but I can only get it to the point where it will look at two of
the fields. If anyone has made an IF work with more than two fields, would
you let me know? The code that works is below. Where I'm getting stuck is
adding in the third field. No matter what I've tried, it throws a field
calculation error when I try to run the merge. I'd really appreciate any help
you might be able to provide.

{ IF { = AND ( { COMPARE {MERGEFIELD ACOL1="Graduate School of Management"
}, {COMPARE {MERGEFIELD AMAJ1_CODE } = "BU-MBA" } ) } = 1 "Contact Name" "" }

If you know of a different way to nest IF statements and can provide an
example, that would be fantastic. I've tried looking on line and in MS Online
help, but this is the best I can locate.

Thanks so much,
 
P

Peter Jamieson

I think you need:

{ IF "{ MERGEFIELD ACOL1 }" = "Graduate School of Management"
"{ IF "{ MERGEFIELD AMAJ1_CODE }" = "BU-MBA"
"Contact Name" "" } "" }

You can probably ditch the "" around the { MERGEFIELD } fields.

Peter Jamieson
 
M

Michelle Craig

Peter,

Thanks so much for pointing me in the right direction. I was able to get it
to work with three nested IFs. It worked great. The code ended up as follows:

{ IF "{ MERGEFIELD ACOL1 }" = "Graduate School of Management"
"{ IF "{ MERGEFIELD AMAJ1_CODE }" = "BU-MBA"
"{IF "{MERGEFIELD ADEG1}" = "MBA" "Contact Name" } "" } "" }
--
Michelle Craig
Kent State University


Peter Jamieson said:
I think you need:

{ IF "{ MERGEFIELD ACOL1 }" = "Graduate School of Management"
"{ IF "{ MERGEFIELD AMAJ1_CODE }" = "BU-MBA"
"Contact Name" "" } "" }

You can probably ditch the "" around the { MERGEFIELD } fields.

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