Lt Element (Query)

Last modified: July 15, 2011

Applies to: SharePoint Foundation 2013 | SharePoint Server 2013

In this article
Attributes
Child Elements
Parent Elements
Occurrences

Arithmetic operator that means "less than" and is used in queries in views. This element is used similarly to the Eq and Gt elements.


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

Attribute

Description

None

N/A

Minimum: 0

Maximum: Unbounded

Remember that Collaborative Application Markup Language (CAML) is case-sensitive; note the lowercase "t" in the Lt element name.

The following example queries for cases where the Deadline field value either equals an empty string or is less than the current date.

<Query>
  <Where>
    <Or>
      <IsNull>
        <FieldRef Name="Deadline" />
      </IsNull>
      <Lt>
        <FieldRef Name="Deadline" />
        <Value Type="DateTime">
          <Today />
        </Value>
      </Lt>
    </Or>
  </Where>
  <OrderBy>
    <FieldRef Name="Modified" Ascending="FALSE" />
  </OrderBy>
</Query>
Show:
© 2014 Microsoft