Syntax
cmdSelect.setSort(sort)
Arguments |
Description |
sort |
sort
is the string specifying the column to sort.
Preceded by a plus (+) or minus (-) will designate
ascending or descending order. The plus sign is optional: placing the column name alone in the sort parameter sorts the recordset in ascending order by default. Secondary sort criteria can be specified with a comma-delimited string of column names. For example, LastName, FirstName |
|
Returns
Return
value is undefined.
Description
cmdSelect.setSort()
specifies
the sort order of the retrieved data. An
exception is thrown if the specified column does not exist
in the table.
Example
The following setSort()example
sorts the LastName field alphabetically.
var sel = new cmdSelect("AddressBook");
sel.setFilter("*");
sel.setSort("+LastName");
var rs = sel.execute();
while(rs.next())
{
response.write(rs.LastName + "<br>");
}
Related
Topics
cmdSelect Object,
cmdSelect.getFilter(), cmdSelect.execute()
|