lundi 23 mars 2015

CAML Query - Data Between Two Date Sets

I'm trying to get the data between two date sets, but the CAML query doesn't seem to be working. I'm trying to get anything opened between the two dates or anything closed between the two dates. When I run each query separate I get the right data, but when I join them I'm not getting anything that was opened in a previous month and closed in March 2015. How do I fix this?



<Query>
<Where>
<Or>
<And>
<Geq>
<FieldRef Name='Opened' />
<Value IncludeTimeValue='TRUE' Type='DateTime'>2015-03-01T00:00:00Z</Value>
</Geq>
<Leq>
<FieldRef Name='Opened' />
<Value IncludeTimeValue='TRUE' Type='DateTime'>2015-03-31T23:58:59Z</Value>
</Leq>
</And>
<And>
<Geq>
<FieldRef Name='Closed' />
<Value IncludeTimeValue='TRUE' Type='DateTime'>2015-03-01T00:00:00Z</Value>
</Geq>
<Leq>
<FieldRef Name='Closed' />
<Value IncludeTimeValue='TRUE' Type='DateTime'>2015-03-31T23:58:59Z</Value>
</Leq>
</And>
</Or>
</Where>
<OrderBy>
<FieldRef Name='ID' Ascending='False' />
</OrderBy>

Aucun commentaire:

Enregistrer un commentaire