Word Mail Merge OR Query

M

Matt Volatile

Dear All,

Can anyone help me simulate an OR command in a Mailmerge field, please? I
can't quite seem to get my head around the required syntax.

I currently have the following command:

[ IF [MERGEFIELD Booker_Booking_Method ] = "Manual Invoice" "AAHCONF/09/[
MERGEFIELD "unique_ID" ]/[ MERGEFIELD "membership_no" ]" "N/A" ] to produce
invoice numbers on receipts. (with curly brackets, of course).

I need to an a simulated OR clause that also returns the invoice number if
Booking_method equals "Online Invoice". Where do I nest the command?

Thanks in advance for your help!
 
G

Graham Mayor

One way would be with a nested field

{ IF{ MERGEFIELD Booker_Booking_Method } = "Manual Invoice" "AAHCONF/09/{
MERGEFIELD "unique_ID" }/{ MERGEFIELD "membership_no" }" "{ IF{ MERGEFIELD
Booker_Booking_Method } = "Online Invoice" "AAHCONF/09/{ MERGEFIELD
"unique_ID" }/{ MERGEFIELD "membership_no" }" "N/A" }"}

or a calculated field

{ IF{ =({ IF{ MERGEFIELD Booker_Booking_Method } = "Manual Invoice" 1 0} +
{ IF{ MERGEFIELD Booker_Booking_Method } = "Online Invoice" 1 0})} = 1
"AAHCONF/09/{ MERGEFIELD "unique_ID" }/{ MERGEFIELD "membership_no" }"
"N/A" }

(see http://www.gmayor.com/formatting_word_fields.htm )

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

Matt Volatile

Thank you so much, Graham. That's worked like a charm!

Graham Mayor said:
One way would be with a nested field

{ IF{ MERGEFIELD Booker_Booking_Method } = "Manual Invoice" "AAHCONF/09/{
MERGEFIELD "unique_ID" }/{ MERGEFIELD "membership_no" }" "{ IF{ MERGEFIELD
Booker_Booking_Method } = "Online Invoice" "AAHCONF/09/{ MERGEFIELD
"unique_ID" }/{ MERGEFIELD "membership_no" }" "N/A" }"}

or a calculated field

{ IF{ =({ IF{ MERGEFIELD Booker_Booking_Method } = "Manual Invoice" 1 0} +
{ IF{ MERGEFIELD Booker_Booking_Method } = "Online Invoice" 1 0})} = 1
"AAHCONF/09/{ MERGEFIELD "unique_ID" }/{ MERGEFIELD "membership_no" }"
"N/A" }

(see http://www.gmayor.com/formatting_word_fields.htm )

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


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


Matt said:
Dear All,

Can anyone help me simulate an OR command in a Mailmerge field,
please? I can't quite seem to get my head around the required syntax.

I currently have the following command:

[ IF [MERGEFIELD Booker_Booking_Method ] = "Manual Invoice"
"AAHCONF/09/[ MERGEFIELD "unique_ID" ]/[ MERGEFIELD "membership_no"
]" "N/A" ] to produce invoice numbers on receipts. (with curly
brackets, of course).

I need to an a simulated OR clause that also returns the invoice
number if Booking_method equals "Online Invoice". Where do I nest the
command?

Thanks in advance for your help!
 
G

Graham Mayor

You are welcome :)

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


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


Matt said:
Thank you so much, Graham. That's worked like a charm!

Graham Mayor said:
One way would be with a nested field

{ IF{ MERGEFIELD Booker_Booking_Method } = "Manual Invoice"
"AAHCONF/09/{ MERGEFIELD "unique_ID" }/{ MERGEFIELD "membership_no"
}" "{ IF{ MERGEFIELD Booker_Booking_Method } = "Online Invoice"
"AAHCONF/09/{ MERGEFIELD "unique_ID" }/{ MERGEFIELD "membership_no"
}" "N/A" }"}

or a calculated field

{ IF{ =({ IF{ MERGEFIELD Booker_Booking_Method } = "Manual Invoice"
1 0} + { IF{ MERGEFIELD Booker_Booking_Method } = "Online Invoice"
1 0})} = 1 "AAHCONF/09/{ MERGEFIELD "unique_ID" }/{ MERGEFIELD
"membership_no" }" "N/A" }

(see http://www.gmayor.com/formatting_word_fields.htm )

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


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


Matt said:
Dear All,

Can anyone help me simulate an OR command in a Mailmerge field,
please? I can't quite seem to get my head around the required
syntax.

I currently have the following command:

[ IF [MERGEFIELD Booker_Booking_Method ] = "Manual Invoice"
"AAHCONF/09/[ MERGEFIELD "unique_ID" ]/[ MERGEFIELD "membership_no"
]" "N/A" ] to produce invoice numbers on receipts. (with curly
brackets, of course).

I need to an a simulated OR clause that also returns the invoice
number if Booking_method equals "Online Invoice". Where do I nest
the command?

Thanks in advance for your help!
 

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