One of the most powerful ways to analyze data in Access is by creating a query. Running a query is like asking your database a question, and it can retrieve data from a single table or multiple tables, depending on how complex your question is.
Let’s say you own a bakery and are planning an upcoming event. You want to create a list of nearby customers to invite to your event. A query can go into the Customers table and find the names and addresses of customers who live in the nearby area.
To create a query in Access 2013, go to the Create tab and click the Query Design command. Select the table or tables you want to retrieve data from. For a simple query using a single table, we’re just using the Customers table for now.
When working with queries, there are two views to use. Design View is used when creating a query, and Datasheet View is used when viewing the results. You can switch between the two views using the View drop-down arrow.
In Design View, the Customers table appears as a small window in the Object Relationship Pane. Double-click each field you want to include in the query, such as First Name, Last Name, Street Address, City, State, and Zip Code. Each field will appear in the Design Grid below.
To refine the query, modify some of the blank cells in the Design Grid. For example, we want to sort the results by last name, so we’ll click the cell under Last Name in the Sort row and choose how we want it to be sorted.
To filter the records and only show customers who live nearby, we’ll use the Criteria row. For example, we want to send invitations to everyone who lives in Raleigh, so we’ll type Raleigh in the City column in quotation marks for an exact match.
To include customers in zip code 27513 in nearby areas, we’ll add another criteria under zip code using the ‘or’ row. We’ll type 27513 in quotation marks, so the query will show customers who are in Raleigh or in zip code 27513.
Finally, run the query by clicking the Run command in the Design tab. The results will appear instantly in Datasheet View, which looks like a table. If you want to make any changes to the query, you can go back to Design View.
In conclusion, creating a query in Access 2013 is a powerful way to analyze your data. This was just a basic example, and in the next video, we’ll talk about how to make a query with multiple tables. Practice this query a few times before moving on to become comfortable with the process. Don’t forget to save your queries as objects for future use.