You can order by clause to get record in ascending or descending following way.     CustTable custTable;    //For ascending order    select custTable order by Name asc;    //For descending order    select custTable order by Name asc;      
Technical Tutorials x++,tips on issues or troubleshooting On Ax ERP ,Microsoft Dynamics 365,Ax 2012,Microsoft , U.S.,Business Software solution.