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.

  1. The query criteria is an expression that Access collects with values ​​in the query fields to determine whether the records contain that value.
  2. Some criteria are simple, just use basic operators and constants. More complex criteria use functions, special operators, and other field references.
  3. 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 .

Set up Query Criteria in Access 2016 Picture 1

In Show Table , select the table you want to query, here is tblNhanvien, double click and select Close.

Set up Query Criteria in Access 2016 Picture 2

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.

Set up Query Criteria in Access 2016 Picture 3

After setting the search criteria, executing the query by clicking the Run command on the Design tab , you will see results like this:

Set up Query Criteria in Access 2016 Picture 4

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.

Set up Query Criteria in Access 2016 Picture 5

Now run the Query again, you will see only the records of employees with titles that are Translated.

Set up Query Criteria in Access 2016 Picture 6

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:

Set up Query Criteria in Access 2016 Picture 7

Results returned:

Set up Query Criteria in Access 2016 Picture 8

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 .

Set up Query Criteria in Access 2016 Picture 9

Results returned:

Set up Query Criteria in Access 2016 Picture 10

Previous article: Data Query (Query Data) in Access 2016

Next article: Action Query in Action 2016

4.4 ★ | 8 Vote

May be interested

  • MS Access 2010 - Lesson 2: Introduction to objects in AccessMS Access 2010 - Lesson 2: Introduction to objects in Access
    database in access 2010 includes four objects: table, query, form and report. these objects work together to allow you to import, store, analyze and compile your data the way you want.
  • The bootcfg query command in WindowsThe bootcfg query command in Windows
    the bootcfg query query and display the entries in the [boot loader] and [operating systems] from boot.ini. the command applies to: windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012.
  • Why use Microsoft Power Query for ExcelWhy use Microsoft Power Query for Excel
    if you're looking for a powerful new way to manage data, microsoft excel for windows now has software built in to help you with that, which is microsoft power query. this is a new tool that helps you take control of your spreadsheets more than ever.
  • Covered Query in MongoDBCovered Query in MongoDB
    when all fields in the query are part of the index, mongodb connects query conditions and returns the result by using the same index without looking inside the document. when indexes are present in ram, retrieving data from indexes is faster when compared to retrieving data by scanning all documents.
  • The reg query command in WindowsThe reg query command in Windows
    the reg query command helps return the next list of subkeys and entries ...
  • Query command in WindowsQuery command in Windows
    (applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)
  • 5 best SQL query optimization software to speed up MySQL5 best SQL query optimization software to speed up MySQL
    the sql query optimizer analyzes many options for a given query, estimates the cost of each of these options, and finally, selects the lowest cost option.
  • Subquery - SUBQUERY in SQLSubquery - SUBQUERY in SQL
    subquery is a query inside another sql query and is embedded in the where clause.
  • Access Exchange 2007 from Apple Macintosh (Part 2)Access Exchange 2007 from Apple Macintosh (Part 2)
    in the last part of this two-part article, i will show you how to configure entourage 2004 for exchange access and then discuss some of the pros and cons of each solution. we will access each client based on the criteria below.
  • LINQ clears query barriersLINQ clears query barriers
    unified programming solution, which provides the ability to query sql syntax data directly in c # or vb.net, applies to all types of data from objects to relational databases and xml.