Chapter 6. Finding Data with Queries

IF ALL YOU NEED TO DO is keep track of a bit of information and go back and look at those details again later, you don’t need a database. A plain old spreadsheet program like Microsoft Excel, which lets you set up lists that work much like a simple database, can do most of the sorting and filtering tricks you learned in the previous chapter.

But you’re not in Excel anymore. In Access, you can sift and scrutinize your information with much more power and flexibility. The key is queries—a database feature that uses a question-and-answer model to let you be very specific about what information you want to see and how you want to see it. Queries also let you make very selective changes to that information without having to change records individually.

For example, through careful crafting of queries, you can:

  • Include or exclude specific rows and/or columns from a table.

  • Combine tables (for example, if two tables in your database happen to contain all the essential ingredients you need, you can force the query to act like there’s just one table that combines the information contained in both tables).

  • Use the same table more than once in the same query.

  • Sort rows.

  • Collapse groups of rows to temporarily hide the contents of those rows from view.

Remember the club membership database you worked with in Chapter 5? In the Members table, you had one ...

Get Access 2003 for Starters: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.