0

The below query works only for each segement alone. Either:

<And>
<Geq>
   <FieldRef Name="Von"/>
   <Value Type="DateTime">{startdatum}</Value>
</Geq>
<Leq>
   <FieldRef Name="Von"/>
   <Value Type="DateTime">{enddatum}</Value>
</Leq>
</And>

or:

<Membership Type="SPGroup" ID="94">
        <FieldRef Name="Created_x002f_By"/>
</Membership>

So what is wrong in combining the two criterias as in the CAML Query below ?

<View Name="{C70CECF5-6037-4095-995E-8FC06199DD27}" Type="HTML" DisplayName="TestDatum" Url="/Lists/Urlaubsantraege/TestDatum.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/generic.png">
            <Query>
                <Where>
                    <OR>
                        <And>
                            <Geq>
                                <FieldRef Name="Von"/>
                                <Value Type="DateTime">{startdatum}</Value>
                            </Geq>
                            <Leq>
                                <FieldRef Name="Von"/>
                                <Value Type="DateTime">{enddatum}</Value>
                            </Leq>
                        </And>
                        <Membership Type="SPGroup" ID="94">
                            <FieldRef Name="Created_x002f_By"/>
                        </Membership>
                    </OR>
                </Where>
            </Query>

Kindly help me to sort it out, Thanks in advance!!! enter image description here

1 Answer 1

0

Try replacing "OR" with "Or" since there are cases when CAML has unpredictable behaviours because of casing.

1
  • I'm using "OR" as you see in the third coding entry.
    – christinaP
    Nov 29, 2013 at 15:53

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.