Set up Query Criteria in Access 2016
The query criteria (Query Criteria) are filter conditions that help you retrieve specific items from an Access database, used when you want to limit results based on values in a field. If the data matches all criteria, it will appear in the query results.
- The query criteria is an expression that Access collects with values in the query fields to determine whether the records contain that value.
- Some criteria are simple, just use basic operators and constants. More complex criteria use functions, special operators, and other field references.
- To add some criteria to the query, you must open the query in Design View and then specify the fields you want to specify criteria.
Let's look at a simple example using criteria in a query. First, open your Access database, then go to the Create tab and click Query Design .
In Show Table , select the table you want to query, here is tblNhanvien, double click and select Close.
In the table window, double click on the name of the field you want to appear in the query. They will be added to the design grid at the bottom of the screen. Here we choose NhanvienID, Ten, Ho, ChucDanh, Dienthoai.
After setting the search criteria, executing the query by clicking the Run command on the Design tab , you will see results like this:
Now, if you want to display only those who have a Title, then add criteria to filter out the required records. Returning to Query Design and in the Criteria line of ChucDanh, enter the filtered value as Bien dich.
Now run the Query again, you will see only the records of employees with titles that are Translated.
If you want to add filtering criteria to multiple fields, just add the data you need to the Criteria line on multiple fields.
If you want to retrieve data with 2 different values in the same field, for example filtering the title Bien tap and Truong nhom , specify the value in the OR row as follows:
Results returned:
If you want to use the function of the AND operator , you only need to specify other conditions in the Criteria row . Let us say that we want to retrieve all the Accountants Assistant but only the Marketing Coordinator titles with "Pollard" are the last name.
For example, if you want to retrieve the data of an employee with the title of Team Leader and Editor , but only the Editing of the Nguyen family .
Results returned:
Previous article: Data Query (Query Data) in Access 2016
Next article: Action Query in Action 2016
You should read it
- Alternate Criteria in Access 2016
- Options to create data queries in Access 2016
- What do you know about data queries?
- MS Access 2003 - Lesson 23: Own query design
- Action Query in Action 2016
- Create data queries in Access 2016 from simple to complex
- MS Access 2003 - Lesson 22: Using Query Wizards
- The multiple-choice question set has an answer to Query P1
- Multiple choice questions have a Query option
- MS Access 2003 - Lesson 21: Chapter 6: Using Query to check data
- The bootcfg query command in Windows
- MS Access 2010 - Lesson 2: Introduction to objects in Access
Maybe you are interested
How to implement infinite scrolling and pagination with Next.js and TanStack Query
What is the unauthorized GraphQL query error that causes Facebook Messenger to not work?
The cost per search query with Google and Microsoft chatbots can cost 10 times more than a regular search query
How to access TPM Diagnostics tool to query security data on Windows 11
What is SQL Query Optimization... and Why Does It Matter?
ENCODEURL function - The function returns a query string with URL code in Excel