now that our database is fully populated
with records it's time to talk about
ways we can look at or analyze our data
sorting is one very basic way to look at
the data you sort data every single day
for example a calendar source
appointments and activities or tracks
birthdays by dates email can sort by who
sent the email the date it was received
or the subject an Excel spreadsheet sort
data to access lets you sort your
records based on any value or field from
which you'd like to pull out specific
information we enter new books into the
database as we get them into our store
which means they are not in any kind of
order
they aren't stored alphabetically by
title or author and they aren't groups
according to their category so how do
you make them appear in some sort of
useful order let's say we want to see
what categories of books we have we
could scroll through the books table to
see each record and note the category of
each one but that could take a long time
if we had hundreds or thousands of books
in our database so instead we can sort
the records based on the category field
so that all the records for a particular
category are grouped together for us
now we can do this in the books table or
using the books form first let's look at
sorting a text field
we'll start by sorting the category
fields in the books table you could do
this from the ribbon using one of the
sort commands on the sort and filter
command group or it is easier to just
click on the arrow at the top of the
category column now this will bring up
some options the same options you have
in the ribbon the first two are your
sorting options the bottom options are
filtering options we'll cover these in
another lesson
you can sort this text column
alphabetically from A to Z or from Z to
a now when you want to clear the sorts
you have to do that from the ribbon with
the clear all sorts commands
the one with the little eraser icon
let's sort on a numerical field this
time let's sort our books by price if we
wanted to see what books are our most
expensive for example select the drop
down arrow at the top of the price
column now you get a few options here -
just like you did when we sort it on
category but notice that the sort
options are now numerical that's because
this field was set up with a data type
of currency which is a numerical value
now we get to decide what order we want
smallest to largest or largest to
smallest
let's choose largest to smallest so the
most expensive book appears first for
each category grouping now what if we
want to do a multi-level sort like you
do in Excel well access into a
multi-level sort but the results can
turn out very differently than you
expect so we recommend that if you want
to sort based on more than one fields
that you either do an advanced filter
which we'll cover in the next lesson or
write a query for that we'll get to both
filtering data and queries and later
lessons sorts pull some very basic
information out of your database for you
our next lesson will show you how to
filter the data in a table