This documentation is archived and is not being maintained.

OrderBy Element

SharePoint 2003

The OrderBy element determines the sort order for a view. It contains a group of FieldRef elements.

Syntax

<OrderBy>
  </FieldRef></FieldRef>
  </FieldRef></FieldRef>
  .
  .
  .
</OrderBy>

Element Relationships

Parent ElementsChild Elements
Query FieldRef

Remarks

The order that the fields appear in is the order by which the fields are sorted. The value of the Ascending attribute in the FieldRef element determines whether to sort in ascending order.

Example

The following example sorts the fields first in ascending order by the Newcomers field, then in descending order by Years, and finally in ascending order by Location.

<OrderBy>
  <FieldRef Name="Newcomers"/>
  <FieldRef Name="Years" Ascending="FALSE"/>
  <FieldRef Name="Location"/>
</OrderBy>

Show: