Neq Element (Query)

Applies to: SharePoint Foundation 2010

Arithmetic operator that means "not equal to" and is used in queries.

<Neq>
  <FieldRef Name = "Field_Name"/>
  <Value Type = "Field_Type"/>
  <XML />
</Neq>

Attributes

Attribute

Description

None

N/A

Child Elements

FieldRef, Value, XML

Parent Elements

And, Or, Where

Occurrences

Minimum: 0

Maximum: Unbounded

Example

The following example queries the Status field for cases where the value does not equal Completed or is null, returning the results according to a descending sort on the Modified field. The Where element contains an Or element to group the filters.

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

See Also

Reference

Eq Element (Query)

Geq Element (Query)

Gt Element (Query)

Lt Element (Query)