Create Queries to Compare Two Fields

Create queries that compare two fields of the same data type (date, integer, etc.).

For example, you may want to compare the date of a pipe clean task to the date of a CCTV inspection, to ensure a pipe was inspected after cleaning. Or you could compare the length of a CCTV inspection to the length the pipe to identify partial inspections.

To compare two fields:

  1. When configuring your rule, use the "Compare to another field of the same data type" checkbox.
  2. Then select the Record Type (this can be the same record type or a different one) and the Field you want to compare to.

    Remember that you will only be able to select fields that have the same data type as the first field you selected.

Note: There are some operators and fields that do not support comparisons:

Using the 'days since' operator in a comparison

The days_since operator (which can be used with date fields) will look for records that are dated within the specified number days of each other.

For example, in the rule below, the query will look for assets that have an inspection dated within 7 days (before or after) of a pipe repair.