Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to filter list by multiple possible values of one specified field, how can i do this in code?
I have following lists: Initiatives, Classes of Initiatives and Departments.enter image description here

I need to retrieve list of Iniciatives, filtered by Classes, that are filtered by Divisions.. So in fact I have for example 2 classes and want to show iniciatives of these two classes.

share|improve this question

2 Answers 2

Department Name should be a lookup column in the Classes List. The Class Name should be a lookup column in the Intiative List. By doing this , you create the basic foreign key relationship as depicted in the diagram.

The above should give you the basic structure to build customized queries on aggregated results from these lists using Dataview webpart. This will help you get started :- http://office.microsoft.com/en-us/sharepoint-designer-help/display-data-from-multiple-sources-in-a-single-data-view-HA010099144.aspx

share|improve this answer
    
I know about lookups) thank you for the link, i just thought that I can do it somehow by linq or caml query –  Ksesh Jul 17 '12 at 9:34
up vote 0 down vote accepted

Find it! Element In - just what I need)

                               <Where>
                                  <In>
                                     <FieldRef Name='Title' />
                                        <Values>
                                          <Value Type='Text'>xx</Value>
                                          <Value Type='Text'>yy</Value>
                                          <Value Type='Text'>zz</Value>
                                        </Values>
                                  </In>
                               </Where>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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