Sorting, Filtering, and Retrieving Data 225 Q3: A3: Q4: A4: (01, 02, 03, and so on). If the field you're sorting by contains only numbers and you sort by the field frequently, you can change the field's data type to Number. If you change the data type, you won't need to include the leading zeros. The list in the Total row includes the First and the Last functions. What do these functions do? Are they used in sorting? These functions return either the first or the last record, respectively, in a query's recordset. I'm not sure when to use a filter and when to use a query. Usually, you'll use a filter to create a temporary view of the data you need to see (although you can save a single filter with a table to use again). Use a query if you need to see a specific recordset repeat- edly. A query also lets you see records from more than one table and to see only a selection of the fields in a table. You don't have those options with a filter. After you complete this chapter: · Go to Chapter 7, "Designing Basic Forms," to learn how to build data entry forms and other types of forms. Go to Chapter 9, "Extending Your Use of Queries" to learn how to create queries with which you can update and delete records and how to perform other database operations with queries. On Your Own Here are some exercises you can do on your own to gain more experience working with queries: 1. Open the Percent Of Budget query we created in this chapter in Design view, and then click View, SQL View. Read through the SQL statements that define this query. Notice that the calculations are included in the SQL statements, and also note how the GROUP BY and ORDER BY statements are used to create the summary groups and the sort order in the query. Create a query using the MarketingCampaigns table and the Tasks table. Add the CampaignID and Country fields from the MarketingCampaigns table and the TaskName, Status, Priority, Start Date, and Due Date fields from the Tasks table. Enter criteria to view the status of all tasks that are due earlier than February 1, 2004. Sort these records by their priority. Make a copy of the query you created in step 2. Modify the query so that only the Cam paignID, Country, and Task table's DueDate fields are included. Create a summary query that counts the number of tasks due before February 1, 2004. Add a parameter to this query for the cam- paign country so that you can see the tasks due for a specific campaign when you run this query. 2. 3.