SharePoint search is extremely powerful, and often users and developers don’t know about some of this power. Below are a few date range queries that our team have found useful in the past.
Searching for items within a particular date range
The “..” operator allows us specify a range of dates in the SharePoint search engine.
Searching for items before a particular date
The earliest date SharePoint allows in its date fields is 1/1/1900, so we search between that and the date we want.
This can also be used in its inverse to exclude items with dates in the past, such as an expiry date. For example, -ExpiryDate:1900-01-01..2017-10-20 would exclude items with an expiry date before 20/10/2017.
Searching for items with no date
This will exclude all items that have any date, as its range is SharePoint’s minimum allowed date to the maximum allowed date.
Searching for items with any date
This will match any non-empty date.