Product DocsMenu

Coveo Platform 7.0 >
User Help > More Advanced Search > Narrowing Results By Date

Narrowing Results By Date

You can use date and time field queries to refine search results for specific dates or time.

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]

Example:

@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.
Time units are seconds (s), minutes (m), hours (h), days (d), months (mo) and years (y).

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.

People who viewed this topic also viewed