Sharepoint Query List Item Using CAML(folder)

<Query>
<Where>
<And>
<And>
<Contains>
<FieldRef Name='Title'/>
<Value Type='Text'>1</Value>
</Contains>
<Leq>
<FieldRef Name='_x52a8__x6001__x53d1__x5e03__x65f6__x95f4_'/>
<Value Type='DateTime'>2010-1-100:00:00Z</Value>
</Leq>
</And>

<Geq>
<FieldRef Name='_x52a8__x6001__x53d1__x5e03__x65f6__x95f4_'/>
<Value Type='DateTime'>2009-1-400:00:00Z</Value>
</Geq>
</And>

</Where>
</Query>
<ViewFields>
<FieldRef Name='Title'/>
</ViewFields>
<QueryOptions />

 

query.ViewAttributes = "Scope='Recursive'"; //设置范围为递归,包含子文件夹

o    ViewAttributes
a. Scope='Default' : 只顯示指定文件夾下的項目及子文件夾
b. Scope='FilesOnly' : 只顯示指定文件夾下的項目
c. Scope='Recursive' : 顯示所有項目,不顯示文件夾
d. Scope='RecursiveAll' : 顯示所有項目和所有子文件夾

 

元素 说明 
And 并且 
BeginsWith 以某字符串开始的 
Contains 包含某字符串 
Eq 等于 
FieldRef 一个字段的引用 (在GroupBy 中使用) 
Geq 大于等于 
GroupBy 分组 
Gt 大于 
IsNotNull 非空 
IsNull 空 
Leq 小于等于 
Lt 小于 
Neq 不等于 
Now 当前时间 
Or 或 
OrderBy 排序 
Today 今天的日期 
TodayIso 今天的日期(ISO格式) 
Where Where子句

原文地址:https://www.cnblogs.com/batter152/p/3596395.html