WD: Conditional Alphanumeric Merge May Yield Incorrect Results |
Q189027
A 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.
This behavior is by design of Microsoft Word. This happens because conditional statements (IF fields) evaluate only the first two characters of a numeric string.
To work around this problem, use the appropriate method for your version of Word.
---------------------------------
| Rec_Num |Name |Number |
---------------------------------
| 1 |John |(1AA) |
---------------------------------
| 2 |Bill |(1AB) |
---------------------------------
| 3 |Fred |(2AA) |
---------------------------------
| 4 |George |(ABC) |
---------------------------------
Modified with an ampersand:
---------------------------------
| Rec_Num |Name |Number |
---------------------------------
| 1 |John |&1AA |
---------------------------------
| 2 |Bill |&1AB |
---------------------------------
| 3 |Fred |&2AA |
---------------------------------
| 4 |George |&ABC |
--------------------------------- {IF {MERGEFIELD number} = "(1A)" "This is true"}If the data begins with an ampersand, modify the field to look like this:
{IF {MERGEFIELD number} = "&1A" "This is true"}
{IF {MERGEFIELD TEST} = "1AB" "This is true"}To use this procedure, follow these steps:
For example, using the following sample data file, 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.
---------------------------------
| Rec_Num |Name |Number |
---------------------------------
| 1 |John |1AA |
---------------------------------
| 2 |Bill |1AB |
---------------------------------
| 3 |Fred |2AA |
---------------------------------
| 4 |George |ABC |
---------------------------------
Additional query words: winword2 numbers strings alphabetic
Keywords : kbdta kbfield winword kbmerge macword word6 winword2 word7 word95
Issue type : kbhowto
Technology :
|
Last Reviewed: November 4, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |