![]() |
Leading the way in Microsoft Office Development |
| Home | | | Excel | | | Word | | | PowerPoint | | | Consultancy | | | Feedback | | | Contact |
| Microsoft Word > Fields > Mail Merge > COMPARE |
| COMPARE expression1 operator expression2 | |
| Compares two values and displays the result "1" if the comparison is true or "0" (zero) if the comparison is false. You can use this field to create compound logical comparisons with AND and OR functions in an = (Formula) field, and then you can use the result of the = (Formula) field in an IF field. |
| expression1 | Values to compare Expressions names, strings of text, numbers, nested fields that return a value, or mathematical formulas If an expression contains spaces, enclose the expression in quotation marks. | |
| expression2 | Values to compare Expressions (expression: Any combination of mathematical or logical operators, constants, functions, and names of fields, controls, and properties that evaluates to a single value Expressions can perform calculations, manipulate characters, or test data.) can be bookmark (bookmark: A location or selection of text in a file that you name for reference purposes Bookmarks identify a location within your file that you can later refer or link to ) names, strings of text, numbers, nested fields that return a value, or mathematical formulas If an expression contains spaces, enclose the expression in quotation marks. | |
| operator | Comparison operator (operator: A sign or symbol that specifies the type of calculation to perform within an expression There are mathematical, comparison, logical, and reference operators.) Insert a space both before and after the operator = Equal to <> Not equal to > Greater than < Less than >= Greater than or equal to <= Less than or equal to |
| REMARKS |
| EXAMPLES | |
| { COMPARE " { MERGEFIELD PostalCode } " = "985*" } { IF { = OR ( { COMPARE { MERGEFIELD CustomerNumber } >= 4 }, { COMPARE { MERGEFIELD CustomerRating } <= 9 } ) } = 1 "Credit not acceptable" "Credit acceptable"} |
| Fields - C | Index - C | Office Online |
| Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved. | Top |