【发布时间】:2018-07-02 15:46:35
【问题描述】:
如何将此 SQL 编写为 CAML?
CurrentDate = Now()
StartDate = '1-1-2018 12:00 AM'
EndDate = '1-1-2018 11:59 PM'
SELECT * FROM Calendar as c
WHERE (c.EventDate <= CurrentDate AND c.EndDate >= CurrentDate)
OR (c.EventDate <= StartDate AND c.EndDate <= EndDate)
This link 看起来不错,但不适用于我想做的事情。
这是我拥有的 CAML,但它不起作用,我收到一个未定义的错误:
<View>
<Query>
<Where>
<Or>
<Leq><FieldRef Name='EventDate' /><Value StorageTZ='TRUE' IncludeTimeValue="FALSE" Type="DateTime">2018-07-01T00:00:00-0400</Value></Geq>
<Geq><FieldRef Name='EndDate' /><Value StorageTZ='TRUE' IncludeTimeValue="FALSE" Type="DateTime">2018-07-01T00:00:00-0400</Value></Leq>
<Or>
<Leq><FieldRef Name='EventDate' /><Value StorageTZ='TRUE' IncludeTimeValue="FALSE" Type="DateTime">2018-07-01T00:00:00-0400</Value></Leq>
<Geq><FieldRef Name='EndDate' /><Value StorageTZ='TRUE' IncludeTimeValue="FALSE" Type="DateTime">2018-07-01T23:59:59-0400</Value></Geq>
</Or>
</Or>
</Where>
</Query>
</View>
【问题讨论】:
标签: sharepoint caml