Try OpenEdge Now
skip to main content
ABL Essentials
Procedure Blocks and Data Access : Language statements that define blocks : FOR blocks : Sorting records by using the BY phrase
 
Sorting records by using the BY phrase
As you've seen, you can sort the records by using the BY phrase. The default is ascending order, but you cannot use the keyword ASCENDING to indicate this. You'll get a syntax error, so just leave it out to get ascending order.
To sort in descending order, add the keyword DESCENDING to the BY phrase:
BY field[ DESCENDING ] ...
To sort on multiple fields, you can repeat the BY phrase.