Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Nested Caml Or Statements

Posted on 2011-09-06
3
Medium Priority
?
486 Views
Last Modified: 2012-05-12
Hello Experts,

Basically, I am trying to write this psuedo-code in CAML.

WHERE
(myList.Title = "Search String") AND
(myList.Field1 = "Some other string") AND
(myList.Field2 = "Yet another string" OR myList.Field3 = "Yet another string" OR myList.Field4 = "Yet another string OR myList.Field5 = "Yet another string")

I can't use LINQ because this is SharePoint 2007.

I have tried using U2U but it doesn't do the OR line in the query and returns nothing. Any help would be appreciated.

Thanks!
0
Comment
Question by:freezegravity
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
ivan_vagunin earned 2000 total points
ID: 36493709
Hi!
The Caml should be following:
<Where>
    <And>
        <Eq><FieldRef Name='Title'/><Value Type='Text'>Search String</Value></Eq>
        <And>
             <Eq><FieldRef Name='Field1'/><Value Type='Text'>Some other string</Value></Eq>
             <Or>
                 <Eq><FieldRef Name='Field2'/><Value Type='Text'>Yet another string</Value></Eq>
                 <Or>
                      <Eq><FieldRef Name='Field3'/><Value Type='Text'>Yet another string</Value></Eq>
                      <Or>
                             <Eq><FieldRef Name='Field4'/><Value Type='Text'>Yet another string</Value></Eq>
                             <Eq><FieldRef Name='Field5'/><Value Type='Text'>Yet another string</Value></Eq>
                      </Or>
                 </Or>
             </Or>
        </And>
    </And>
</Where>
0
 

Author Comment

by:freezegravity
ID: 36504464
Thanks a ton! Worked beautifully!
0
 
LVL 18

Expert Comment

by:ivan_vagunin
ID: 36504879
Welcome)
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010genera…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question