无法按日期和时间数据类型过滤和排序 [英] unable to filter and order by date and time data type

查看:91
本文介绍了无法按日期和时间数据类型过滤和排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部好,


我是sharepoint的新手,我有一项任务是使用c#console程序从sharepoint 2010中提取数据。


<经过短暂的研究后我决定使用CSOM,我需要根据日期和时间值(无论是创建还是修改)从sharepoint过滤数据,我总是失败或错误!但是,如果我使用具有差异数据类型的另一个字段,例如
"ID","标题"等,那么它是有效的。对于数据和时间数据类型的任何特定处理是否在"where"中进行过滤。声明和"按顺序"声明?


请告知..

解决方案

< View> <查询> <其中GT&; <等式> < FieldRef Name ='ProjectStartDate'/>< Value Type ='DateTime'> 2017-06-20T12:00:00Z< / Value> < /等式> < /何处> < /查询> < / View> 




这是Date字段类型的CAML示例。


HI All,

I am new in sharepoint and I have a task to extract data from sharepoint 2010 using c# console program.

after a short research I decided to use CSOM, and I need to filter data from sharepoint based on date and time value (either createdon or modifiedon), I always get failed or error!! but it was work if I use another field with difference data type such as "ID", "Title", etc.. is there any specific treatment for data and time data type for filter in "where" statement and "order by" statement?

please advise..

解决方案

<View> <Query> <Where> <Eq> <FieldRef Name='ProjectStartDate' /><Value Type='DateTime'>2017-06-20T12:00:00Z</Value> </Eq> </Where> </Query> </View>


This is a CAML example for Date field type.


这篇关于无法按日期和时间数据类型过滤和排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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