> Herb 50 Payroll / Example: Expressions with operators

See also

Operators

Expressions

Herb 50 Payroll example: Expressions with operators

Here are some examples of using operators in expressions.

Operator

Action

+

Use a plus sign to add values.

This filter is active for all employees whose net pay in the full tax year to date, plus an additional value of £500.00, is greater than £15,000.

(Employees.NetPayTD + 500.00) > 15000

-

Use a minus sign to subtract values.

This filter is active for all employees whose net pay in the full tax year to date, minus an additional value of £500.00, is greater than £15,000.

(Employees.NetPayTD - 500.00) > 15000

*

Use an asterisk to multiply values.

This filter is active for all employees whose net pay in the full tax year to date, multiplied by 1.5, is greater than £15,000.

(Employees.NetPayTD * 1.5) > 15000

/

Use a forward slash to divide values. Divide. For example, 5/2 = 2.5.

This filter is active for all employees whose net pay in the full tax year to date, divided by 2, is greater than £15,000.

(Employees.NetPayTD / 2) > 15000

^

Use ^ for exponential functions; for example, 3^2 means 3 to the power of 2, which results in 9.

This expression can be used to display the value on the report or as part of another expression.

%

Use a percent symbol to calculate percentages.

If you calculate 5%2, you get 1.

This example can be used to display the value on the report or as part of another expression.

LIKE

Use LIKE to test if a string contains information.

Employees.Reference LIKE "Ref1"

This filter is active for the employee with the reference Ref1.

NOT

Use a logical NOT to test is a statement is false.

This filter is active for all employees apart from the employee with the reference Ref1.

Employees.Reference NOT LIKE "Ref1"

AND

Use a logical AND to test if all statements are true.

This filter is active for employees where their net pay in the full tax year to date is greater than £5000, but their gross National Insurance contributions are less than £500.

Employees.NetPayTD > 5000 AND Employees.NICGrossTD < 500

OR

Use a logical OR to test if at least one or another statement is true.

This filter is active for employees where their net pay in the full tax year to date is greater than £5000, or their gross National Insurance contributions are more than £1500.

Employees.NetPayTD > 5000 OR Employees.NICGrossTD > 1500
NULL

You can use the NULL operator to specify that a value contains no data.

You must use this operator with the equal (=) operator.

Note: Not all blank areas within Herb 50 Payroll are null values. This operator is most commonly used with a date value, where the date can be left blank.

This filter is active for all employees with no work end date specified within their employee record .

Employees.WorkEndDate = NULL

()

Use brackets (parentheses) to group parts of the expression, to define the order in which it is evaluated.

If you need the filter to be active for monthly paid employees, but also for any employees who are paid in cash on a weekly basis, you could enter the filter as follows:

Employees.PaymentPeriod LIKE "Monthly" OR Employees.PaymentPeriod LIKE "Weekly" AND Employees.PaymentMethod LIKE "Cash"

However, when you view this filter it is not clear which of the conditions belong together - this filter can also be interpreted as including either monthly or weekly paid employees, but only where the payment method is set to cash. To ensure the filter applies for the correct employees, you can insert brackets as follows:

Employees.PaymentPeriod LIKE "Monthly" OR (Employees.PaymentPeriod LIKE "Weekly" AND Employees.PaymentMethod LIKE "Cash")

>

Compare if a value is greater than another value.

This filter is active for all employees whose net pay in the full tax year to date is greater than £15,000.

Employees.NetPayTD > 15000

<

Compare if a value is less than another value.

This filter is active for all employees whose net pay in the full tax year to date is less than £15,000.

Employees.NetPayTD < 15000

=

Compare if a value is equal to another value.

This filter is active for all employees whose net pay in the full tax year to date is exactly £15,000.

Employees.NetPayTD = 15000

>=

Compare if a value is greater than or equal to another value.

This filter is active for all employees whose net pay in the full tax year to date is greater than or equal to £15,000.

Employees.NetPayTD >= 15000

<=

Compare if a value is less than or equal to another value.

This filter is active for all employees whose net pay in the full tax year to date is less than or equal to £15,000.

Employees.NetPayTD <= 15000

<>

Compare if a value is not equal to another value.

This filter is active for all employees whose net pay in the full tax year to date has any value other than £15,000.

Employees.NetPayTD <> 15000

Go to top