I'm trying to retrieve a list of items where some conditions are applied but when I run my web page it returns all records. basically this query checks whether any record with these conditions exist or not, if exist function will validate and will not create a new item and vice versa
Here's what my CAML query looks like:
<Query>
<Where>
<And>
<Eq><FieldRef Name='Name' LookupId='TRUE' /><Value Type='Integer'>28</Value></Eq>
<And>
<Neq><FieldRef Name='WorkflowStatus'/><Value Type='Text'>Rejected</Value></Neq>
<And>
<Neq><FieldRef Name='ID' /><Value Type='Number'>173</Value></Neq>
<And>
<Geq><FieldRef Name='HRLastDayOfLeave'/><Value Type='DateTime' IncludeTimeValue='FALSE'>2015-10-9</Value></Geq>
<Leq><FieldRef Name='HRFirstDayOfLeave'/><Value Type='DateTime' IncludeTimeValue='FALSE'>2015-10-8</Value></Leq>
</And>
</And>
</And>
</And>
</Where>
</Query>