How to Use Greater than and Less than in CAML
SPQuery query = new SPQuery();
query.Query = @"<Where>
<And>
<And>
<Or>
<And>
<Geq>
<FieldRef Name='FromDate' />
<Value Type='DateTime'>2013-11-13T12:00:00Z</Value>
</Geq>
<Leq>
<FieldRef Name='FromDate' />
<Value Type='DateTime'>2013-12-03T12:00:00Z</Value>
</Leq>
</And>
<Geq>
<FieldRef Name='ToDate' />
<Value Type='DateTime'>2013-11-13T12:00:00Z</Value>
</Geq>
</Or>
<Leq>
<FieldRef Name='ToDate' />
<Value Type='DateTime'>2013-12-03T12:00:00Z</Value>
</Leq>
</And>
<Eq>
<FieldRef Name='Column1' />
<Value Type='Text'>f2</Value>
</Eq>
</And>
</Where>";
SPQuery query = new SPQuery();
query.Query = @"<Where>
<And>
<And>
<Or>
<And>
<Geq>
<FieldRef Name='FromDate' />
<Value Type='DateTime'>2013-11-13T12:00:00Z</Value>
</Geq>
<Leq>
<FieldRef Name='FromDate' />
<Value Type='DateTime'>2013-12-03T12:00:00Z</Value>
</Leq>
</And>
<Geq>
<FieldRef Name='ToDate' />
<Value Type='DateTime'>2013-11-13T12:00:00Z</Value>
</Geq>
</Or>
<Leq>
<FieldRef Name='ToDate' />
<Value Type='DateTime'>2013-12-03T12:00:00Z</Value>
</Leq>
</And>
<Eq>
<FieldRef Name='Column1' />
<Value Type='Text'>f2</Value>
</Eq>
</And>
</Where>";
No comments:
Post a Comment