Search This Blog

Tuesday, April 27, 2010

Display Today and Tomorrow events from a Calendar - using CAML

Here is the CAML
<Or>


<Eq>

<FieldRef Name="EventDate" />

<Value Type="DateTime">

<Today />

</Value>

</Eq>

<Eq>

<FieldRef Name="EventDate" />

<Value Type="DateTime">

<Today OffsetDays="1" />

</Value>

</Eq>

</Or>

The important part of this CAML is the OffsetDays keyword that allows to get future or past dates relative to Today. For example: Data for past 2 days would be OffSetDays="-2"

Well this one is a very well known formula, however I want to write this in my blog for quick syntax reference.

No comments: