REST API STARTSWITH不适用于SharePoint DateTime列 [英] REST API STARTSWITH not working for SharePoint DateTime Column

查看:70
本文介绍了REST API STARTSWITH不适用于SharePoint DateTime列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我编写了下面的REST API来过滤SharePoint DateTime列的数据,但我发现执行没有运气



另外,当我使用  startswith  对于SinglelieText列,它工作正常。但是对于
DateTime列我无法破解



任何人都可以让我知道什么是它错了..



 url :_spPageContextInfo.webAbsoluteUrl +" / _ api / web / lists / GetByTitle('OrderDetails')/ items?$ filter =(startswith(OrderDate,'3'))",








SP Assest

解决方案

据我所知,StartsWith是一个字符串函数,无法使用使用dateTime字段。对于您正在尝试的内容,您需要从日期中提取月份值。 因此,使用Month()来代替Starts.


https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-的OData查询的操作功能于SharePoint的休息,请求#排序返回项


I had written the below piece of REST API to filter the data for SharePoint DateTime Column , But I find no luck to execute

Also, When I use startswith for SinglelieText column it's working fine. But for DateTime Column I am unable to crack

Can any one please do let me know what's wrong in it..

url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('OrderDetails')/items?$filter=(startswith(OrderDate,'3'))",



SP Assest

解决方案

To the best of my knowledge StartsWith is a string function and can't be used with a dateTime field. for what you are trying you need to extract the month value from the date.  So in place of Starts with use Month().

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-rest-requests#sort-returned-items


这篇关于REST API STARTSWITH不适用于SharePoint DateTime列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆