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.


expression1Values 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.
expression2Values to compare
Expressions can be bookmark 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
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
* An expression can be 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.)
* If the operator is = or <>, Expression2 can contain a question mark (?) to represent any single character, or an asterisk (*) to represent any string of characters. The expression must be enclosed in quotation marks so that it is compared as a character string. If you use an asterisk in Expression2, the portion of Expression1 that corresponds to the asterisk, plus any remaining characters in Expression2, cannot exceed 128 characters.
* This field can be used 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.
* You can also use the two wildcards ? and * in your expressions.
* For the Microsoft documentation refer to support.microsoft.com

Examples

{ COMPARE " { MERGEFIELD PostalCode } " = "985*" }
{ IF { = OR ( { COMPARE { MERGEFIELD CustomerNumber } >= 4 }, { COMPARE { MERGEFIELD CustomerRating } <= 9 } ) } = 1 "Credit not acceptable" "Credit acceptable"}

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top