Sort Fields

Once you have selected fields, it is possible to define one or several sort conditions on selected fields only.

Sorting data can play a big role in making a report or form effective and easy to use. This topic explains how to sort records when viewing and designing a query, or report. There may be times when you want to sort data by alphabetical or numerical order. For example, a product catalog that lists the products in alphabetical order or on the basis of unit price is much easier to use than one that lists the items in random order.

 

What do you want to do?

hdarrow.gif  Sort a field

hdarrow.gif  Remove a sort order

hdarrow.gif  Change the order of sorted fields by moving a field

hdarrow.gif  Change the order of sorted fields without moving a field

hdarrow.gif  Open the ClicknDECiDE SQL Editor

hdarrow.gif  Open the Table tab

 

 

Sort a Field

Once you have selected fields, it is possible to define one or several sort conditions on selected fields only. The sort depends on the data type to be sorted, for example for a numeric sort, an ascending sort displays the record with the smallest value on top and the record with the largest value at the bottom. A descending sort does the opposite.

For a date sort, an ascending sort in the first column displays January at the top and December at the bottom. An ascending sort in the second column displays 1 at the top and 31 at the bottom. A descending sort order does the opposite.

One thing to remember when applying sort orders is that numbers, text, and special characters are sorted according to the selected language and regional settings of your computer, the resulting sort orders might not match your expectations.

 

To sort a field, perform the steps below:

  1. Ensure the field you want to sort on has been selected. For more information, click here...

  2. Click the blue button in the Sort column to the left of the field you want to sort. An ascending sort icon appears by default to indicate that the sort on the field will be ascending.

  3. To use an ascending sort: leave the default ascending sort unchanged.
    To use a descending sort: click the
    ascending sort icon in the Sort column to the left of the field you want to sort, the descending sort icon will appear .

 

htop.gif Top of Page

 

Remove a Sort Order

To remove a sort order on a field, perform the steps below:

  1. Click the ascending/ descending icon in the Sort column to the left of the field on which you want to remove the sort. The blue square will appear indicating that the sort order has been removed.

 

htop.gif Top of Page

 

 

Change the Order of Sorted Fields by Moving a Field

To change the order of sorted by fields by moving a field, perform the steps below:

  1. Select the field you want to move in the data grid.

  2. Hold down the mouse button.

  3. Perform a drag-and-drop operation and move the field to the location you want.


     

  4. Release the mouse button. The sort condition will be automatically changed in the SQL Editor. (ORDER BY statement)

htop.gif Top of Page

 

Change the Order of Sorted Fields without Moving a Field

To change the order of sorted fields without moving a field, perform the steps below:

  1. Click the sort icon or click Query> Order by.... The Order by... dialog box appears.


     

  2. Note the fields with a sort will be displayed.

  3. Click the ascending/ descending icon to the left of the field name or double-click the field row to modify the sort condition from ascending to descending or the opposite. box.

  4. Move a field up or down by clicking the up/ down arrows. The sort condition will be automatically changed in the SQL Editor. (ORDER BY statement).

 

htop.gif Top of Page 

See Also