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.
    – Phil Greer
    Oct 2, 2014 at 16:13
  • Thans Phil, here is the code
    – user33961
    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
    Oct 3, 2014 at 14:06
  • try this link---dhondiyals.wordpress.com/2010/07/27/…
    – Madhav
    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
    – user33961
    Oct 3, 2014 at 8:08

Your Answer

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

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