Sunday, November 21, 2021

Filter data in a query

Queries retrieve rows and columns from tables. After you run a query, you can further limit the number of items shown in the datasheet by applying filters. Filters are a good choice when you want to temporarily limit the query results without going into Design View to edit your query. For more information about creating queries, see Introduction to queries.

To filter data in a query, open it in Datasheet View, click the down-arrow at the top of a column, and select a filter option.

Here's how it looks in an Access app:

Filtering a column in a query in an Access app.

You can select multiple values from the list, but in an app, the filter list closes each time you select an option. You can keep building the filter by reopening the list and selecting new items. For more information about Access apps, see Create an Access app.

And here's how it looks in a desktop database:

Filtering a query column in a desktop database.

Note the Date Filters option in the list—in a desktop database, you can choose more specialized filters depending on the data type of the column. For example, in a text field, you'll see a Text Filters option, and in a numeric field, you'll see a Number Filters option. These filters make it easier to filter for a range of values, rather than selecting all the values individually.

All filters are automatically cleared when you close the query. Or, you can clear a filter from a column by clicking clicking Clear Filter in the list.

For more information about creating queries, see Introduction to queries, and for more detailed information about filtering, see Apply a filter to view select records in an Access database.

No comments:

Post a Comment