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

  <Lists> <List ID="{17B687AC-F88F-45D5-9074-1E91A9BBD3B0}" /> </Lists> 
  <ViewFields> <FieldRef Name="ID" /> </ViewFields> 
      <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> 
      <Neq> <FieldRef Name="Contract_x0020_Duration" /> <Value Type="Choice">Ad Hoc</Value> </Neq> 
      <Eq> <FieldRef Name="Contract_x0020_Status" /> <Value Type="Choice">Open</Value> </Eq> 
      <Eq> <FieldRef Name="Contract_x0020_Status" /> <Value Type="Choice">{WorkflowVariable:Var_Null}</Value> </Eq> 

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.

  • 1
    Please share your CAML. The synopsis helps, but it's better to see the full code.
    – Phil Greer
    Commented Oct 2, 2014 at 16:13
  • Thans Phil, here is the code
    – user33961
    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.
    – Phil Greer
    Commented Oct 3, 2014 at 14:06
  • try this link---dhondiyals.wordpress.com/2010/07/27/…
    – Madhav
    Commented Apr 20, 2016 at 9:51

1 Answer 1


Part of the query you list includes:

ReviewDate <= today AND ReviewDate > tomorrow

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

  • sorry my mistake meant ReviewDate< Var_Tomorrow AND ReviewDate >=(greater than or equal to)Var_Today @PhilGreer
    – user33961
    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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.