View Single Post
  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Skip Record if Comparison of Several Fields Fails

To keep things simple, one way you /might/ be able to do it is as follows:

If your complete set of IF fields and text inserts no text at all (not even
any spaces or paragraph marks) in the situation where you want to skip the
letter, then copy the entire body of your mailmerge main document (probably
except the last paragraph mark) and paste it into a SKIPIF field, i.e. as
follows:

{ SKIPIF "all your fields and text" = "" }all your fields and text

(i.e. if it works, it's simpler than trying to work out a second set of IF
fields and so on).

Peter Jamieson

"Nick" wrote in message
oups.com...
Sorry to be ambiguous. I have been trying to figure out how I can copy
the mail merge instructions so you can see them, but can't figure it
out, so, I will bite the bullet and type them in.

Data fields include:

ClientPosition (whether our client is the "1","2" or "3" choice or
"FALSE" if not selected)
Issue D rating for 1st choice client (1-5 reported where "1" is most
favorable - up to "4" which is least favorable and "5" is no opinion)
Issue D rating for 2nd choice client
Issue D rating for 3rds choice client

Mail merge does the following:
1. check to see if client position=1
2. checks to see that rating for 1st choice is not null
3. checks to see that rating for 2nd choice is not null
4. checks to see that rating for 1st choice is less than 5
5. subtracts value of 1st choice rating from value of second choice
rating to see if it is less than zero
6. If it is the text is activated. If it isn't it
7. checks to see if client position=2, etc.

{IF {MERGEFIELD ClientPosition } = 1 "{IF {Q2_C2D } "" {IF {Q2_C1D }
"" { IF {Q2_C1D } 5 { IF { = { Q2_C2D } - { Q2_C1D } } 0 "Text
here for client in first position rated lower than competitor in second
position

" "{ IF {Q2_3D } "" { IF { Q2_C1D} "" { IF { Q2_C1D } 5 { IF {
= { Q2_C3D } - {Q2_C1D } } 0 "Text here for client in first position
rated lower than competitor in third position

" "" } } } } " } } } } }{IF {MERGEFIELD ClientPosition } = 2 "{IF
{Q2_C2D } "" {IF {Q2_C1D } "" { IF {Q2_C2D } 5 { IF { = { Q2_C1D
} - { Q2_C1D } } 0 "Text here for client in second position rated
lower than competitor in first position

" "{ IF {Q2_2D } "" { IF { Q2_C3D} "" { IF { Q2_C2D } 5 { IF {
= { Q2_C3D } - {Q2_C2D } } 0 "Text here for client in second position
rated lower than competitor in third position

" "" } } } } " } } } } }, etc.

I'm looking for a way to skip the record if none of the statements
trigger the associated text.

Thanks for looking at this for me.

Nick King