May 16, 2021 MS Access
Query criteria can help you retrieve specific items from the Access database. ia. f you want to limit the results of a query based on the values in the field, you use query criteria.
The query condition is that Access compares the query field value to determine whether to include an expression for the record that contains each value.
Some standards are simple and use basic operators and constants. Others are complex, using functions, special operators, and include field references.
To add some conditions to a query, you must open the query in the design view.
Then, determine the field for which you want to specify the criteria.
Let's look at a simple example, and we'll use conditions in the query. First open your Access database, then go to the Create tab, and then click Query Design.
In the Table tab of the Display Table dialog box, double-click the tblEmployees table, and then close the dialog box.
Now let's add some fields to the query grid, such as ImployeeID, FirstName, LastName, JobTitle, and Email, as shown in the screenshot below.
Now let's run your query and you'll only see these fields as the result of the query.
If you only want to see those whose JobTitle is a marketing coordinator, you need to add conditions to it. Let's go to query design again and enter the Marketing Coordinator in jobTitle's Criteria line.
Let's run your query again and you'll see that only the marketing coordinator's title is retrieved.
If you want to add conditions to more than one field, simply add conditions in more than one field.
Let's say that we just want to retrieve data from the Marketing Coordinator and accounting assistant;
We can specify the OR line operator, as shown in the following screenshot -
Let's run your query again and you'll see the following results.
If you need to use the functionality of the AND operator, you must specify additional conditions in the Conditions row. me.
Now let's run the query again and you'll see the following results.