Using Data Dictionaries > Expressions and Functions > Build Compound Expressions
Related topics

Using Expressions

Use the Expression Builder

Functions

Alphabetical List of Functions

About Expressions and Functions

Build Compound Expressions

You can also build an expression that consists of more than one comparison. This is referred to as a compound expression.

Suppose you want to search for all active employees who were hired before June 1, 2016. Here we need to create two comparisons: the first one tells the system to find employees who have an (A)active status; the second comparison tells the system that of those active employees, it should find only those who were hired before 6/01/2016.

Using the Expression Builder, you would build the following compound expression:

PE.P_ORIGHIRE<{06/01/2016} AND PE.P_ACTIVE="A"

The two expressions are divided with the word "AND" telling the system to find the employees who satisfy both comparisons. If you used the word "OR" to divide the two expressions, Sage HRMS would find two sets of employees: those who were hired before 6/01/2016 and those who have an Active status. This would result in a much higher number of employees than if you used the "AND" function.

Rules for Using Field Names in an Expression or Function

  1. All field names must be spelled correctly. See the Data Dictionary for correct spellings.
  2. Alphanumeric (character) data must be surrounded by quotes.
  3. Dates must be enclosed in braces, i.e. {06/01/2016}.
  4. If you are building a compound expression (when you need more than one condition to be met), the conditions must be separated by the word AND or by the word OR. You should use parentheses in complex conditional expressions.
  5. Use the following comparison operators:
    =

    Does a compare between two values of the same type.

    The = operator performs a comparison between two values of the same type. This operator is suited for comparing character, numeric, date, and logical data.

    However, when you compare character expressions with the = operator, the results might not be exactly what you expect. Character expressions are compared character for character from left to right until one of the expressions isn’t equal to the other, or until the end of the expression on the right side of the = operator is reached.

    Example: ="GA" will find both GA and GAUI

    ==

    Does an exact comparison of character data.

    When two character expressions are compared with the == operator, the expressions on both sides of the == operator must contain exactly the same characters, including blanks, to be considered equal.

    Example: =="GA" will find GA, but not GAUI

    >

    Greater than

    >=

    Greater than or equal to

    <

    Less than

    <=

    Less than or equal to

    <>

    Not equal to

Important! Capitalization is important. For example,"SALESREP" is not equal to "SalesRep". To avoid capitalization problems, use the UPPER function to make comparisons. The following example tells the system to convert the job code to upper case before making the comparison: UPPER(PE.P_JOBCODE)="SALESREP"