Penn State Home Page

Teaching and Learning with Technology

Teaching with Databases

  TLT Home : TLT Suggestions

Main Menu

LOCATION: HOME PAGE: SEARCH TIPS

Sorts

If your search results pull up a large number of records, then you may want to sort the list on some criteria, either to organize it or to bring up the more relevant records to the top of the list.

Common Sorts

Ascending vs. Descending Sorts

Database programs often distinguish between ascending sorts which arrange records from lowest value to highest value and descending sorts which arrange records from highest to lowest value.

Alphabetical and numeric sorts are examples of ascending sorts and reverse alphabetical and reverse numeric are descending sorts.

Chronological (Descending)

This sort brings records with the newest dates to the top of the list. This is often useful in article research for finding the most relevant citations first.

Category Keyword (Ascending)

Another useful sort is to sort records by keyword category so that records about the same topic are grouped together.

Other Sorts

A review of other types of sorts can be found in the "About Databases" section.

Complex Sorts

Another tool of databases are complex sorts where records are sorted by one field then each group of records is sorted by another field. For instance, a database listing art images could be sorted by artist name first, then chronologically by date of art work.

Art List : By Artist then Date

Skip List

Manet, Edouard

  • 1860 - Portrait of Monsieur and Madame Manet
  • 1863 - Olympia
  • 1866 - The Fifer
  • 1868 - Luncheon in the Studio
  • 1876 - Portrait of Stephane Mallarme

Monet, Claude

  • 1875 - Red Boats in Argenteuil
  • 1897 - The Waterlilly Bridge
  • 1908 - Grand Canale and Santa Maria della Salute
  • 1914-1917 - The Path Among the Irises
  • 1923 - The Japanese Bridge

 

Note that complex sorts can take place over three or more fields depending on the record set. For instance, if there were more than one painting for a year, then you could have a third sort to arrange paintings in the same year in alphabetical order by title.

Performing Sorts (Table Mode)

Sorts are often the easiest to view if the database is set in table view mode in which records are displayed in rows and columns. Simple sorts can be done

Filemaker Pro

Simple Sorts

  1. If desired, switch to table view by going to the View menu then View as Table.
  2. Scroll to a field you wish to sort on. Click the column name for an ascending sort. Click again for a descending sort.
  3. To exit table view, go to View » View as Form (data entry screens) or View as List (reports).

Complex Sorts

  1. Go to the Records menu, then Sort Records.
  2. Highlight the field you wish to sort on in the left window, then click the Move button to transfer it to the right Sort Order window.
  3. Choose a sort option for either Ascending, Descending or Custom order.
  4. For complex sorts, move each field to the right "Sort Order" window and choose a sort order. The first field listed represents the first or primary sort, and other fields are secondary or tertiary sorts.

Access

Simple Sorts (Filter Mode)

This works from a form.

  1. If desired, switch to table view by going to the View menu then Datasheet View .
  2. Scroll to a field you wish to sort on. In the toolbar, click the A-Z button for an ascending sort or the Z-A button for a descending sort.
  3. To exit table view, go to View » Form View.

Complex Sorts (Query Mode)

When developing a query, each field selected as a parameter can be designated as having an Ascending or Descending sort (third line). The left-most field is the primary sort.

Excel

As will be discussed in the Databases in Disguise section, Excel is a simple database with sorting capabilities.

Simple Sorts

Scroll to a column you wish to sort on. In the toolbar, click the A-Z button for an ascending sort or the Z-A button for a descending sort.

Complex Sorts

  1. Highlight all the rows and columns containing data you wish to sort on. Do not include column names.
  2. Go to the Data menu, then Sort.
  3. Select the column name for the first primary sort, then click the Ascending or Descending option.
  4. Select other columns for the secondary sorts, choosing "Ascending" or "Descending", then click OK.

 

Other Programs

Programs such as EndNote, Eudora, and even folder views in Windows and Macintosh support simple sorts. Whenever the data is displayed as a list of items, clicking the column name will often cause data to be sorted on that column.

Many online databases also support multiple sorts. Here is a page from http://www.senate.gov which allows sorting of a senate list by name, state name or political party.

Senate Listing with Sort Options on Top

Next: Dissecting Codes
Prev: Define Ranges

Top of Page

OTHER SECTIONS: Home Page | Site Map | Glossary | Teaching Ideas

© 2004-2005 The Pennsylvania State University.

This Website is maintained by Elizabeth Pyatt (ejp10@psu.edu) for Teaching and Learning with Technology, a unit of Information Technology Services.

Last Update: August 1, 2005