Or Element (Query)

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Used within the Where element to group filters in a query.

<Or>
</Or>

Attributes

Attribute

Description

None

N/A

Child Elements

And, BeginsWith, Contains, DateRangesOverlap, Eq, Geq, Gt, IsNotNull, IsNull, Leq, Lt, Membership, Neq, Or

Parent Elements

And, Or, Where

Occurrences

Minimum: 0

Maximum: Unbounded

Remarks

This element can be nested inside other Or and And elements. The server supports unlimited complicated queries.

Example

The following example performs a query for cases in which values of the Status field either do not equal Completed or are null. The results are sorted in descending order according to the Modified field.

<Query>
  <OrderBy>
    <FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
  </OrderBy>
  <Where>
    <Or>
      <Neq>
        <FieldRef Name="Status"></FieldRef>
        <Value Type="Text"></Value>
      </Neq>
      <IsNull>
        <FieldRef Name="Status"></FieldRef>
      </IsNull>
    </Or>
  </Where>
</Query>