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 have search and see the way how to write CAML Query with 3 AND conditions. However, I am not sure how to write CAML Query with more than 3 AND conditions may be with 4 or 5 AND conditions.

Can any body write for me the CAML Query with 4 or 5 AND conditions. Or any link showing that Query ?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

Just continue to nest the queries...

<And>
    <Eq>... condition...</Eq>
    <And>
        <Eq>... condition...</Eq>
        <And>
            <Eq>... condition...</Eq>
            <And>
                <Eq>... condition...</Eq>
                <Eq>... condition...</Eq>
            </And>
        </And>
    </And>
</And>
share|improve this answer
    
Check the Query below, is that is correst ? –  SPBeginer Jan 11 '13 at 16:29

just use CAML Query builder. This is free tool, just use it's visual interface to create queries of different complexity.

Update: The link to u2u builder above is broken now. Currently I use SPCAMLQueryHelper from codeplex instead.

share|improve this answer
    
link is broken. Is this still available? –  Colbs Jun 10 at 16:38
    
Currently I use another builder, possibly u2u doesn't support old builder anymore. See my update above. –  Anton Khritonenkov Jun 10 at 20:58

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.