The information in this article applies to:
SYMPTOMSIn some cases, Word may sort numbers incorrectly. Case 1When you perform a numeric sort operation on numbers that contain hyphens, such as social security numbers, phone numbers, and nine-digit ZIP Codes (postal codes), Word may sort the numbers incorrectly.Case 2Similarly, Word may sort your mail merge data incorrectly when you sort mail merge data records by using the Sort Records tab in the Query Options dialog box.CAUSECase 1If you select Number for the Sort By Type setting in the Table Sort Numbers dialog box, Word treats the hyphen as a minus sign. As a result, Word performs a subtraction operation and then sorts the difference. For example, if you sort the following list of nine-digit postal codes, Word performs a subtraction operation and then sorts the result.
Case 2Similarly, in a mail merge operation, if you perform a sorting operation based on a field that contains hyphenated numeric data, Word automatically treats your data as numeric and, therefore, uses the hyphen as a minus sign. (To sort from a mail merge operation, open the Mail Merge Helper and then click Query Options.)NOTE: Word treats the data in any mail merge field as numeric if the first character in the field is a number. WORKAROUNDMethod 1: Sort as TextTo correctly sort numbers that contain hyphens, select Text as the Sort By Type setting in the Table Sort Numbers dialog box.Method 2: Sort Data File Before MergingFor a mail merge operation, if you want to sort based on a field that contains hyphenated numbers, sort the data source before you perform the mail merge operation instead of using the Mail Merge Helper.Method 3: Replace Hyphens Before You Sort the DataIf you want to sort hyphenated data and use the Number (Numeric) Type setting, follow these steps:
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. Additional query words: incorrect calculates hyphenated hyphenation mailmerge math mathematical merge numbers numeric print subtracts working wrong
Keywords : kbdta word97 kbmerge |
Last Reviewed: October 19, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |