【发布时间】:2012-07-19 11:31:45
【问题描述】:
您能告诉我如何使用 CAML 查询将作为 DateTime 字段存储在 SPList 中的日期和时间与当前系统时间进行比较吗?
【问题讨论】:
标签: sharepoint caml splist
您能告诉我如何使用 CAML 查询将作为 DateTime 字段存储在 SPList 中的日期和时间与当前系统时间进行比较吗?
【问题讨论】:
标签: sharepoint caml splist
与今天的日期比较:
<Where>
<Lt>
<FieldRef Name='Created'/>
<Value type='DateTime'><Today /></Value>
</Lt>
</Where>
比较今天的日期和时间
<Where>
<Lt>
<FieldRef Name='Created'/>
<Value type='DateTime' IncludeDateTime='TRUE'><Today /></Value>
</Lt>
</Where>
比较昨天的日期
<Where>
<Lt>
<FieldRef Name='Created'/>
<Value type='DateTime'><Today Offset='-1' /></Value>
</Lt>
</Where>
【讨论】:
比较昨天的日期应该是“OffsetDays”
<Where>
<Lt>
<FieldRef Name='Created'/>
<Value type='DateTime'><Today OffsetDays='-1' /></Value>
</Lt>
</Where>
【讨论】: