Search for Documents within a Specified Date Range

The docdate() function finds documents within a certain date range.

Syntax

docdate(restriction_type,date_1[,date_2])

The optional parameters restriction type, date_1, date_2 are used to set a target date range. The parameters date_1, date_2 should be in "mm/dd/yyyy" format.

The restriction_type parameter defines the type of comparison and accepts one of the following values:

Restriction type

Comments

lt/less/<

Document date is less than date_1.

le/less or equal/<=

Document date is equal to or less than date_1.

gt/greater/>

Document date is greater than date_1.

ge/greater or equal/>=

Document date is equal to or greater than date_1.

eq/equal/=

Document date is equal to date_1.

ne/not equal/!=

Document date is not equal to date_1.

bt/between/()

Document date belongs to an open range (date_1, date_2).

be/between or equal/[]

Document date belongs to a closed range [date_1, date_2].

lo/left-open/(]

Document date belongs to a left-open range (date_1, date_2].

ro/right-open/[)

Document date belongs to a right-open range [date_1, date_2).

If the restriction type includes mathematical symbols (>, (), !=, etc.), they should be enclosed in quotes (">", "()", "!=", etc.).

Example

docdate() matches documents with a date.

not docdate() matches documents without a date.

docdate(equal,"8/28/2017") matches the documents of 28 August 2017.

The function also accepts the optional named parameters year, month, day, hour, minute, second that limit the query to a particular year, month, day, hour, minute or second. When using these parameters, other arguments in the function should be omitted.

docdate(year:>2001) matches documents after 2001.

docdate(month:=10|11) matches documents for October or November of any year.

docdate(month:=10|11, year:= 2002|2003) matches documents for October or November of 2002—2003.

docdate(year:=2002, day:>10, day:<15) matches documents from the 10th to the 15th day of any month of 2002.

Note

The function requires a date and time column to be set in the Index node properties.

pdl docdate 1

Task example: Searching for reviews within a specified date range

Users can write the following query expression to find all customer reviews from the first May 2019 till the 31st May 2022:

docdate("[]", "05/01/2019", "05/31/2019") = docdate("()", "04/30/2019", "06/01/2022")

pdl docdate 2

Users could also limit their search to a specific day:

docdate("=","05/7/2022")

pdl docdate 3

If users are interested in finding occurrences of a certain word within a certain date range, they can write a query specifying a time period, as well as the word they are looking for:

"customer review" and docdate("[]", "05/05/2023", "07/05/2023").

pdl docdate 4