Condition

Specify the condition that causes the event to fire.

This condition typically involves either a time operation or a database calculation, or both.

Each condition consists of one of these values:

  • A Boolean keyword
  • Two non-Boolean expressions separated by a comparison operator

For example:

  • This example causes the event to fire when seven days have elapsed since the current result of the database function dbo.LastEntryDate():

    DATEDIFF(day, DBFUNCTION(LastEntryDate), CURDATETIME()) > 7

  • This example causes the event to fire when the balance on a certain customer's order is greater than $10,000:

    DBFUNCTION(OrderBalance, GC(BigCustNum)) > 10000

  • This example causes the event to fire on the first day of each month:

    DATEPART(day, CURDATETIME()) = 1

For information on conditions and triggers, see Event Triggers.