WD2001: Conditional Word Merge Field Returns Incorrect Results (275358)



The information in this article applies to:

  • Microsoft Word 2001 for Macintosh

This article was previously published under Q275358

SYMPTOMS

You can use an If...Then...Else field in a Microsoft Word 2001 merge document to return a specific result depending on the content of the data in each record of the data source. This Word merge field returns incorrect results when the following conditions are true:
  • The first character in both the data field and the merge field criteria is numeric.

    -and-
  • The leading numeric characters up to the first non-numeric character in the merge field criteria are identical to the numeric characters up to the first alphabetical character in the data field.

    -and-
  • The first alphabetical character in the data field is not separated from the leading numeric characters by more than one of the following special characters:

    `~@#$&_,.?<>;:'"[]{}\|

NOTE: It is not necessary for there to be alphabetical characters in the conditional merge field for a match to occur with data that contains alphabetical characters.

It is also not necessary for the alphabetical characters in the conditional merge field to match the alphabetical characters in the data field, as long as the leading numeric characters match.

The question mark (?) and the asterisk (*) return different results when they are used at the end of the leading numeric characters in the merge field criteria.

Examples

NOTE: In the following table, <char> equals one of the following special characters

`~@#$&_,.?<>;:'"[]{}\|

and <altchar> equals one of the following special characters:

!%^()=+-*/

   MergeField      Matches              Fails 
   Criteria                             To Match
   ----------      -------              ----------- 
   123             123                  12 or 1234
                   123ABC               321ABC
                   123<char>            123## or 123<altchar>
                   123<char>ABC         123##ABC or 123<altchar>ABC
                                   

   123ABC          123                  12 or 1234
                   123XXX               12ABC or 1234ABC or 321ABC
                   123<char>            123## or 123<altchar> 
                   123<char>XXX         123##ABC or 123<altchar>ABC 
                   123??XXX or 123??456

   123<char>ABC    123                  12 or 1234
                   123XXX               12ABC or 1234ABC or 321ABC
                   123<char>            123## or 123<altchar>
                   123<char>XXX         123##ABC or 123<altchar>ABC

   123?            123                  12 or 1234
                   123XXX               12ABC or 1234ABC or 321ABC
                   123<char>            123## or 123<altchar>
                   123<char>XXX         123##ABC or 123<altchar>ABC
                   123??
                   123??XXX or 123??456

   123??           123                  12 or 1234
                   123XXX               12ABC or 1234ABC or 321ABC
                   123<char>            123<altchar>
                   123<char>XXX         123##ABC or 123<altchar>ABC
                   123?? 
                   123<char><char> 
                   123??XXX or 123??456

   123*            anything starting with 123


				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

For more information about Word merge fields, follow these steps:
  1. On the Help menu, click Contents and Index, click Index, and then click M.
  2. Scroll down until you locate merge, and then click the arrow to the left to view a list of topics under the general topic.
  3. Click Word fields for use in data merge.
If you cannot find the information that you want, ask the Office Assistant.


Modification Type:MajorLast Reviewed:10/14/2002
Keywords:kbbug KB275358