Forum Discussion
Avi65
Apr 26, 2023Brass Contributor
How to do search in list for date range
Hello,
I have one date field i.e. PlantDate.
I am trying to do search in list as PlantDate=2/1/2021..2/8/2023
It is not returning any search result.
Hello Avi65
in search queries you can use different date intervals. Here are an overview about supported date intervals in KQL: https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference#relevant-date-intervals-supported-by-kql
Best, Dave
- Avi65Brass ContributorHello Dave,
I already gone thru this and tried as well example of lastmodifiedtime and it is working too, but as I mentioned it is not working for custom field i.e. PlantDate as expected. It might be it is custom field not a managed metadata field, where lastmodifiedtime is a metadata field.
AvianHello Avi65
i have tested it and it works with custom date columns.
I have mapped my date and time columns to RefinableDate columns. My example with query:
{SearchTerms} Path:"<TENANT>/sites/MSTEvents/Lists/SessionTracker/" RefinableDate01>2022-01-01 AND RefinableDate02<2022-01-31
Best regards, Dave