I'm working on a query that shows us a list of our
bakery's customers
who live outside the city limits.
And there are a couple of things that I'm going to
do to make the results easier to read:
sorting the results, and hiding fields that we
don't need to see.
Right now, I'm in Datasheet view, so I'll need to
switch to Design view.
There are two ways of doing that.
You can either go to the View drop-down arrow and
select Design view,
or in the bottom-right corner, you can click the icon on the far right.
In the data grid, there is a sort row, which is
currently empty.
To add a sort you can just click on the cell for
the field you want to sort,
and then click the drop-down arrow to choose a sort option.
Now, our results will be sorted alphabetically by
city.
You can also do a multilevel sort by just adding a
sort to another field.
A multilevel sort will always work from left to
right,
so this is going to sort first by city, and then within each city it will sort by zip
code.
If we wanted it to sort by zip code first, then we
would have to change the ordering of the columns.
And you can do that by clicking at the top of a
column and dragging it to the left or right.
So this would sort first by zip code and then by
city.
But that's not what I want, so I'm just going to
leave it where it was.
Below the Sort row, there is a check box for each
field,
and you can uncheck a box to hide the field in the results.
We're using the Phone Number field to filter our
results,
but we don't actually need to see the phone numbers, so I'll uncheck this.
And I'm also going to hide the ID field.
This is really just a way of making the results easier to read
by reducing the amount of information that you have to look at.
Now, we can Run the query again,
and you can see that our results are sorted by city,
and within each city they're sorted by zip code,
and the Phone Number and ID fields are hidden
so we can just focus on the names and addresses.