无法通过REST API中的Month()函数提取Month [英] Unable to extract Month by using Month() function in REST API

查看:104
本文介绍了无法通过REST API中的Month()函数提取Month的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,


  • 我试图在下面的代码中使用REST API中的Month()函数从SharePoint DateTime列获取月份遵循参考https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-rest-requests#sort-returned-items。

  • 但我找不到合适的方法,任何人都可以让我知道它有什么问题,请帮助我解决问题。 b $ b




 function Getmonth()
 {
    $.ajax({
   
    url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('Order')/items?$Select=OrderDate&$filter=month(OrderDate) eq 3",

               type: "GET",
               headers: {"accept": "application/json;odata=verbose"},
               success: function (data) {
                  if (data.d.results) {
                        MarchitemsCount = data.d.results.length;
                        alert(MarchitemsCount);
                   
                   }
             },
             error: function (xhr)
             {
                alert(xhr.status + ': ' + xhr.statusText);
             }
       });
 }

推荐答案

请通过以下链接解决您的疑虑。

Please go through below link to address your concerns.

https://sharepoint.stackexchange.com/questions/122199/rest-api-filter-by-month?utm_medium=organic& ; utm_source = google_rich_qa& utm_campaign = google_rich_qa

https://sharepoint.stackexchange.com/questions/122199/rest-api-filter-by-month?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa


这篇关于无法通过REST API中的Month()函数提取Month的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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