PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • How to proceed?
  • Adding a sort item into the current select query
  • Deleting a sort item from the current Select query
  • Modifying the sort order of an item in the current select query
  • Tip
  • Notes
  • Defining several sort items
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
To make the result of a query easier to read, the records can be sorted according to one or more items. Sorting the records means classifying them in an ascending order or in descending order.
For example, the customers can be sorted by name, from A to Z.
Note: Only the items displayed in the query result can be sorted.
The sort order is defined when creating the query. However, you can:
  • add or delete a sort item.
  • modify sort order on an item.
How to proceed?

Adding a sort item into the current select query

To add a sort item into the current select query:
  1. Select "Query .. Query description". The description window of query is displayed.Display the description window of query: on the "Query" pane, in the "Edit" group, click "Description".
  2. In the middle section, select the requested item.
  3. Display the popup menu of the item, select "Sort the item" and select the sort order.
Notes:
  • To add a sort item, you also have the ability to click the "Sort" button found in the right section and to select "Sort on the selected item".
  • The query editor can also be used to perform a sort on a parameter. All you have to do is click the "Sort" button and to select "Sort on a parameter". In this case, you must specify the name of the parameter that will be used for the sort as well as the default sort order. This sort order can be modified at run time if the content of the parameter contains the sort order. For example: "Customer.CustomerName ASC". This parameter must be passed to the query when it is run. See Passing parameters to a query for more details.

Deleting a sort item from the current Select query

To delete a sort item from the current select query:
  1. Select "Query .. Query description". The description window of query is displayed.Display the description window of query: on the "Query" pane, in the "Edit" group, click "Description".
  2. In the middle section, select the requested item.
  3. Display the popup menu of this item (right mouse click).
  4. Select "Sort the item .. Don't sort".

Modifying the sort order of an item in the current select query

To modify the sort order of an item in the current select query:
  1. Select "Query .. Query description". The description window of query is displayed.Display the description window of query: on the "Query" pane, in the "Edit" group, click "Description".
  2. In the middle section, select the requested item.
  3. Display the popup menu of this item (right mouse click).
  4. Select "Sort the item" and select the new sort direction for the item.

Tip

To add, modify or delete a sort, click the column used to sort the query items and select the operation to perform in the following menu:
Sort menu
Notes

Defining several sort items

When several sort items are defined, the sorts are nested. To find out the sequence of the different items, click Sort order found in the middle section. The sort starts from the first item found in the table of sorted items.
For example, in the window below, the query result is sorted:
  • on the total amount of orders first,
  • then on the country of customers,
  • then on the city of customers,
  • finally on the name of customers.
Sequence of sorts
The arrows found to the right of the window are used to modify the sequence of sort items.
Note: The numbers found beside the arrows also allow you to find out the sequence of the different sort items.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment