Microsoft Office Tutorials and References
In Depth Information
Session 3.1
8. Click the Save button
on the Query Datasheet toolbar. The Save As dialog box opens.
9. Type EmployerPositions in the Query Name text box, and then press the Enter key.
Access saves the query with the specified name and displays the name in the title bar.
Matt decides he wants the records displayed in alphabetical order by employer name.
Because the query displays data in order by the field value of EmployerID, which is the
primary key for the Employer table, you need to sort the records by EmployerName to dis-
play the data in the order Matt wants.
Sorting Data in a Query
Sorting is the process of rearranging records in a specified order or sequence. Sometimes
you might need to sort data before displaying or printing it to meet a specific request. For
example, Matt might want to review position information arranged by the StartDate field
because he needs to know which positions are available earliest in the year. On the other
hand, Elsa might want to view position information arranged by the Openings field for
each employer, because she monitors employer activity for NSJI.
When you sort data in a query, you do not change the sequence of the records in the
underlying tables. Only the records in the query datasheet are rearranged according to
your specifications.
To sort records, you must select the sort field , which is the field used to determine the
order of records in the datasheet. In this case, Matt wants the data sorted by the employer
name, so you need to specify EmployerName as the sort field. Sort fields can be text,
number, date/time, currency, AutoNumber, yes/no, or Lookup Wizard fields, but not
memo, OLE object, or hyperlink fields. You sort records in either ascending (increasing) or
descending (decreasing) order. Figure 3-12 shows the results of each type of sort for differ-
ent data types.
Sorting results for different data types
Figure 3-12
Data Type
Ascending Sort Results
Descending Sort Results
A to Z
Z to A
lowest to highest numeric value
highest to lowest numeric value
oldest to most recent date
most recent to oldest date
lowest to highest numeric value
highest to lowest numeric value
lowest to highest numeric value
highest to lowest numeric value
yes (check mark in check box) then no values
no then yes values
Access provides several methods for sorting data in a table or query datasheet and in a
form. One method, clicking a toolbar sort button, lets you sort the displayed records quickly.
Using a Toolbar Button to Sort Data
The Sort Ascending and Sort Descending buttons on the toolbar allow you to sort records
immediately, based on the values in the selected field. First you select the column on which
you want to base the sort, and then you click the appropriate sort button on the toolbar to
rearrange the records in either ascending or descending order. Unless you save the datasheet
or form after you’ve sorted the records, the rearrangement of records is temporary.
Search JabSto ::

Custom Search