MS Word

Filter Using a Numerical Field

The Problem:

I'm not having much luck with filtering using a numerical field. If I filter for all records with amounts under 50, for example, Word reads 100 from the left and includes those records, too.

The Solution:

This problem most often occurs with street addresses (for example, 88 Acacia Blvd.), but it also occurs with other fields that mix numbers with text (e.g., 42 boxes). Word identifies such fields as alphanumerical rather than numerical, and the filtering is handled differently. In your case, it will include all records with amounts ranging from 049, 100499, 1,0004,999, and so on. To get around this, you'll need to split the non-numerical data from the numerical data in the field.

To apply filtering to a field, click the Edit button in the Mail Merge Recipients dialog box, click the "Filter and Sort" button to display the Filter and Sort dialog box, and then click the Filter Records tab. Choose the appropriate field, and enter the comparisons and values for it. The example in Figure 9-12 matches quantities from 1 up to and including 100, excluding records for which the quantity is blank (which typically implies a value of 0).

Figure 9-12. Use the Filter Records tab of the Filter and Sort dialog box to implement filtering on a numerical field.