Friday 12 June 2015

CAML Query with multiple "and" and "or" statements

The SQL satatement is :


Select * from Sales where (ProductID = J1539 AND ProductID = J9862) AND (ProductID = J0394 OR ProductID = J4589)




  
    
      
      J1539
    
    
      
      J9862
    
  
  
    
      
      J0394
    
    
      
      J4589
    
  

The following example performs a query for cases in which values of the Status field do not equal Completed and values of the Sent field are null. The records returned are sorted in descending order according to values of the Modified field.

  
    
  
  
    
      
        
        Completed
      
      
        
      
    
  

The following example shows how to conjoin three conditions. Note that the first pair of conditions are within their own And element, which is itself a condition of an outer And element.

  
    
      
        Bagel
      
      
        Jean
      
    
    
      President
    
  


No comments: