0

I have a SharePoint caml query that checks a SharePoint list if ReviewDate < Var_Tomorrow AND ReviewDate >= Var_Today AND ContractDuration not = to Ad Hoc AND ContractStatus = open OR ContractStatus = empty

<Query> 
  <Lists> <List ID="{17B687AC-F88F-45D5-9074-1E91A9BBD3B0}" /> </Lists> 
  <ViewFields> <FieldRef Name="ID" /> </ViewFields> 
    <Where> 
      <Or> 
      <And> 
      <And> 
      <And> 
      <Geq> <FieldRef Name="Review_x0020_Date" /> <Value Type="DateTime">{WorkflowVariable:Var_TodayNoTime}</Value> </Geq> 
      <Lt> <FieldRef Name="Review_x0020_Date" /> <Value Type="DateTime">{WorkflowVariable:Var_TomorrowDate}</Value> </Lt> 
      </And> 
      <Neq> <FieldRef Name="Contract_x0020_Duration" /> <Value Type="Choice">Ad Hoc</Value> </Neq> 
      </And> 
      <Eq> <FieldRef Name="Contract_x0020_Status" /> <Value Type="Choice">Open</Value> </Eq> 
      </And> 
      <Eq> <FieldRef Name="Contract_x0020_Status" /> <Value Type="Choice">{WorkflowVariable:Var_Null}</Value> </Eq> 
      </Or> 
    </Where> 
</Query>

It's not returning any documents even though there is a document that meets all of the above criteria but for some reason it's not finding it.

4
  • 1
    Please share your CAML. The synopsis helps, but it's better to see the full code. Commented Oct 2, 2014 at 16:13
  • Thans Phil, here is the code Commented Oct 3, 2014 at 7:18
  • 1
    It works best to add to your original question using the "edit" button below the question. The comments section should be used to respond to other users follow-up questions and for brief discussion/clarification. I'll add the code to your question for you and format it properly. Commented Oct 3, 2014 at 14:06
  • try this link---dhondiyals.wordpress.com/2010/07/27/… Commented Apr 20, 2016 at 9:51

1 Answer 1

0

Part of the query you list includes:

ReviewDate <= today AND ReviewDate > tomorrow

I don't think these conditions can be simultaneously satisfied.

1
  • sorry my mistake meant ReviewDate< Var_Tomorrow AND ReviewDate >=(greater than or equal to)Var_Today @PhilGreer Commented Oct 3, 2014 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.