WD: Conditional Alphanumeric Merge May Yield Incorrect ResultsLast reviewed: February 2, 1998Article ID: Q97484 |
The information in this article applies to:
SYMPTOMSA print merge or mail merge operation may yield incorrect results if you use a conditional statement to evaluate alphanumeric data when the first character of the data is numeric.
CAUSEThis happens because conditional statements (IF fields) evaluate only the first two characters of a numeric string.
MORE INFORMATIONFor example, using the sample data file below, the following conditional statement incorrectly yields a true result for the first and second records, although only the second record satisfies the condition:
{IF {MERGEFIELD NUMBER} = "1AB" "This is true"}NOTE: The IF field evaluated only the first two characters (1A) of the numeric string.
Sample Data File
--------------------------------- | Rec_Num |Name |Number | --------------------------------- | 1 |John |1AA | --------------------------------- | 2 |Bill |1AB | --------------------------------- | 3 |Fred |2AA | --------------------------------- | 4 |George |ABC | --------------------------------- WORKAROUNDTo work around this problem, use the appropriate method for your version of Word.
Word Versions 6.x, 7.x, 97, 98 Macintosh EditionModify the data so that each field begins with a non-numeric character. Then modify the conditional field in the main merge document to match the data.
Word Version 2.xIf your alphanumeric data contains entries that begin with a numeric character, use the print merge Record Selection feature to perform a conditional merge of the data. By setting record selection rules, you can merge only data records that meet the criteria you specify. The disadvantage of this workaround is that you must perform multiple print merge operations if your main document contains more than one conditional statement for alphanumeric fields. In this case, you must modify your main document for each condition, change the Record Selection settings to evaluate each condition individually and then perform a separate print merge operation. The functionality of the Record Selection feature differs from that of an IF field, so you must modify your print merge procedure accordingly. For example, the following procedure uses the Record Selection feature to perform a conditional print merge of the sample data file above. This procedure replaces the following conditional statement:
{IF {MERGEFIELD TEST} = "1AB" "This is true"}
Word Version 1.x
|
Additional query words: winword2 numbers strings alphabetic
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |