WD: Use of "AND" and "OR" with Print Merge Selection Rules (79266)



The information in this article applies to:

  • Microsoft Word for Windows 2.0
  • Microsoft Word for Windows 2.0a
  • Microsoft Word for Windows 2.0b
  • Microsoft Word for Windows 2.0c
  • Microsoft Word for Windows 6.0
  • Microsoft Word for Windows 6.0a
  • Microsoft Word for Windows 6.0c
  • Microsoft Word for Windows 95
  • Microsoft Word for Windows 95 7.0a
  • Microsoft Word 97 for Windows

This article was previously published under Q79266

SUMMARY

In Word, you can define "rules" 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 "AND" and the logical meaning of "AND" to use these rules effectively.

MORE INFORMATION

The English language meaning of "AND" is equivalent to the logical meaning "OR." 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 "Include the records for North Carolina AND for Washington." Logically, however, the statement is written as "Include the records where STATE is North Carolina OR STATE is Washington."

When you use a logical "AND," both conditions must be true in order for the expression to be evaluated as true. If you write the statement "to include the records where STATE is North Carolina AND STATE is Washington," 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 "AND" and "OR" 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.
				

REFERENCES

"Microsoft Word for Windows User's Guide," version 2.0, pages 634, 670

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:kbfield kbmerge kbualink97 kbusage KB79266