8

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 ?

2 Answers 2

20

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>
1
  • 1
    Check the Query below, is that is correst ?
    – SPBeginer
    Jan 11, 2013 at 16:29
2

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.

3
  • link is broken. Is this still available? Jun 10, 2014 at 16:38
  • Currently I use another builder, possibly u2u doesn't support old builder anymore. See my update above. Jun 10, 2014 at 20:58
  • the new link no longer works either, the SPCAML one. Jan 4, 2023 at 1:08

Your Answer

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

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