Tinderbox v9 Icon

Basic Comparison Operators

Queries & conditional expressions support 6 basic comparison operators:

Comparing Date-type data

When working specifically with Date-type values, some special variations of outcome occur.

Using the == and != operators. Queries regard two dates as being equal if they share the same year, month, and day, regardless of the time of day. This makes useful agent expressions that use the == equality operator. In early releases, equality looked only for identical time stamps, which was rarely what users expected.

For all other comparison types. Here the time element of date-time attribute's value is taken into account. Where no explicit time is set, the time defaults to '00:00' (hh:mm). Seconds are not displayed in Displayed Attributes or Get Info. Seconds are '00' in most cases unless specifically set otherwise (via action code or use of designators link 'now').

To test the exact equivalence of date-time attribute values use interval() where an exact match returns the string "00:00".


Note that the comparison operators >, >=, < and <= continue to compare both date and time. It is possible, for example, for the same note to be discovered by two agents with different query operators, one that locates $TheDate < today and another that searches for $TheDate == today. If the $TheDate has a time of 14:30 and today has a time of 11:00 then both queries will match; the first matches simple on a time agnostic whole-day basis, the second matches because 14:40 is later (greater) than 11:00.

The date parser accepts the following expressions as placeholders for calculated dates (within quoted string literals):

There is a further special case:

Day placeholders Sunday, Monday, etc., may be used. Tinderbox recognises the day of the week (in English, currently) and interprets it as the day after today with that week day. Thus, on Sunday June 1, the date placeholder "Sunday" refers to Sunday, June 8.

In other respects, days of the week act like today and can be modified similarly, e.g. "Monday - 1 week" evaluates as the previous Monday.

Parentheses (rounded brackets) can be used to indicate a hierarchy of resolution:

($Cost > (450 * $Margin)) & ($Priority == "High") 

The code in parentheses is resolved before the '&' join is made.

Agent query comparison operations will accept expressions on their right-hand side. This is legal syntax: $Width > ($Height * 2)