Creating Queries  «Prev  Next»

Specifying Sort Order - Exercise Result

You entered:

Refine your Access Query

Final Access
The diagram shows a Microsoft Access relationship diagram and a query design interface. From this, we can analyze the tables and their relationships:
Tables
Relationships Here's the requested HTML structure:
  1. Clients → Projects
    • A one-to-many relationship exists between the Company field in the Clients table and the Company field in the Projects table. This indicates that a single company can have multiple projects.
  2. Projects → Hours
    • A one-to-many relationship exists between the Project ID field in the Projects table and the ProjectID field in the Hours table. This indicates that a single project can have multiple entries in the Hours table.

Query Analysis The query in the design view is set up as follows:
  • Fields in the Query:
    • Project Description (from Projects table)
    • Date (from Hours table)
    • Hours worked (from Hours table)
  • Sorting:
    • Date is sorted in ascending order.
  • Criteria:
    • Date has a condition: Between #8/31/99# And ... (criteria appears partially cut off but suggests a date range filter).

This setup indicates a query designed to show project descriptions, dates, and hours worked, filtered by a specific date range and sorted chronologically by date.

Your result should appear like this in the Design view.
There is more than one way to enter the Date criteria; however, because there are two criteria for a single field joined by AND, both criteria must be entered in the Criteria row. Either of the following correctly defines the criteria:
  1. Between 8/31/99 And 11/1/99
  2. >=9/1/99 And <=10/30/99
  3. >8/31/99 And <11/1/99

Access will add the # to mark the dates automatically if you do not add them. To save the query with a new name, choose File>>Save As from the menu, type the new name, and press Enter. To define the sort order, click the Sort row for the Date column, display the drop-down list, and choose Ascending.
Your datasheet should look like this:
Compile specs for network hardware
Compile specs for network hardware

Namecheap 1