Narrowing Results By Date
Date and time fields use a query syntax that includes relative or static values. Relative values are dependent on a date operator (ex.: today) and time reference (ex.: 8h ago). Static values are fixed dates and/or time (ex.: 2007/08/09@09:21:01).
Querying date and time fields with relative values
Use the following syntax to query a date and time field with a relative value:
@[fieldName][RelationalOperator][DateOperator][+/-][TimeReference]
@date>=today-7d
Finds all documents created or modified over the last week.
The following table describes these components.
Component | Possible values | Example |
---|---|---|
Field name | All date/time field types (see Available Field Aliases) | @sysdate |
Relational operator | =, <>, >, >=, <, <= (see Mathematical Operators) | > |
Date operator | now, today, yesterday (see Date/Time Operators) | yesterday |
Mathematical operator | +, - (see Mathematical Operators) | + |
Time reference (optional with now, today, and yesterday) |
All numbers and decimals
Note: The decimal symbol is a dot, not a comma. |
12h |
Querying date and time fields with static values
Use the following syntax to query a date and time field with a static value:
@[fieldName][RelationalOperator][yyyy/mm/dd@hh:mm:ss]
where:
-
years are four-digit values (ex.: 2012)
-
months are two-digit values (ex.: 04 or 12)
-
days are two-digit values (ex.: 01 or 31)
-
hours range from 00 to 24, AM or PM symbols are not allowed
-
time part (@hh:mm:ss) is optional
Example:
@date>=2012/01/01
Finds all documents created or modified since the beginning of year 2012.