In SharePoint 2013 on-premises site, if you are trying to apply a filter on EndDate column (or EventDate column) of a Calendar List using REST API, it throws the below error.
Basically we cannot use EndDate column in the filter query. That sounds weird but it looks to be a "miss" from the SharePoint product team.
However, it is interesting to note that this filter works fine in SharePoint Online (SPO). So the sample query like below returned valid items.
So, the Product team might have fixed the issue in SPO. Hope this should be resolved at least in SP2016.
The field 'EndDate' of type 'DateTime' cannot be used in the query filter expression.
Basically we cannot use EndDate column in the filter query. That sounds weird but it looks to be a "miss" from the SharePoint product team.
However, it is interesting to note that this filter works fine in SharePoint Online (SPO). So the sample query like below returned valid items.
https://domain/sites/pub/_api/web/lists/getByTitle('Calendar')/items?$select=Title,EndDate&$filter=EndDate lt '2018-05-31T23:59:00Z'
So, the Product team might have fixed the issue in SPO. Hope this should be resolved at least in SP2016.
Comments
Post a Comment