Chapter 4. Queries

I don’t know how to fix my own car, which is why I pay somebody to do it for me. This arrangement suits me just fine. But if I didn’t know how to drive my own car, that would be a different story entirely. It would be almost as bad as, well, having a database and not being able to write my own queries.

That said, I’m sorry to tell you that query Design View can be one of Access’s most baffling interfaces—but if you want to go anywhere, you’ve gotta use it. In this chapter, we’ll do our best to get you over the speed bumps, and we’ll offer fixes and workarounds for query Design View’s idiosyncrasies and deficiencies. We’ll also offer guidance for creating queries that may seem impossible, but can generate some very useful results. When you’re done with this chapter, you’ll know some of the tricks that hard-core Access stunt drivers use—tricks you should try at home.

QUERY BASICS

Query a Single Table

THE ANNOYANCE: I need to generate a list of names and phone numbers for just those employees who live in Massachusetts—but our employees table includes workers in eight states. I can’t make any sense out of query Design View. Where do I start?

THE FIX: Access’s query Design View really drives people crazy. It’s not intuitive, but once you get used to it it’s really pretty useful. Since querying data is what it’s all about, you must learn how to make query Design View dance to your tune. (Incidentally, Access does have a Simple Query Wizard, which you can find by clicking ...

Get Fixing Access Annoyances 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.