Microsoft KB Archive/79266

= WD: Use of &quot;AND&quot; and &quot;OR&quot; with Print Merge Selection Rules =

Article ID: 79266

Article Last Modified on 11/16/2006

-

APPLIES TO


 * Microsoft Word 2.0 Standard Edition
 * Microsoft Word 2.0a
 * Microsoft Office Word 2003
 * Microsoft Word 2.0c
 * Microsoft Word 6.0 Standard Edition
 * Microsoft Word 6.0a
 * Microsoft Word 6.0c
 * Microsoft Word 95 Standard Edition
 * Microsoft Word 95a
 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q79266



SUMMARY
In Word, you can define &quot;rules&quot; that determine whether or not a specific record is included in a print merge. It is important to understand the difference between the English language meaning of &quot;AND&quot; and the logical meaning of &quot;AND&quot; to use these rules effectively.



MORE INFORMATION
The English language meaning of &quot;AND&quot; is equivalent to the logical meaning &quot;OR.&quot; For example, suppose you have a data file that includes a STATE field and you want to perform a print merge of the records for the STATE fields of North Carolina and Washington. In English, you say &quot;Include the records for North Carolina AND for Washington.&quot; Logically, however, the statement is written as &quot;Include the records where STATE is North Carolina OR STATE is Washington.&quot;

When you use a logical &quot;AND,&quot; both conditions must be true in order for the expression to be evaluated as true. If you write the statement &quot;to include the records where STATE is North Carolina AND STATE is Washington,&quot; it is logically impossible for both conditions to be true in the same record. The state cannot be both North Carolina and Washington; it has to be one or the other. Below is a chart that describes how logical &quot;AND&quot; and &quot;OR&quot; are evaluated.   If X=A OR Y=B        If EITHER is true, the record is included. If X=A AND Y=B      If BOTH are true, the record is included.

