How to Create a Yes or No Query in Microsoft Access

preview_player
Показать описание
In this tutorial, we will learn how to create a query in Access with a Yes or No criterion.

In this easy step by step tutorial, we will teach you how to create a query in Microsoft Access based on a Yes or No criterion. Microsoft Access is a database system which provides an easy to use interface for the end user. Tasks like creating, and managing databases, creating tables and queries to fetch data from those tables has been made easy in Microsoft Access.

Step#1: Create a new Query

Just consider the Products table of this sample database here.

Notice that there are some products in this database which are discontinued. Now what if you want to limit the search results based on certain values in a field. For that, we can create a query in Access using a Yes or No criterion, tabulating the results based on that particular field.

To begin, move to the Create tab and then click on the Query Design option in the Other Section.

Now let's add the products table from here and close the selection window.

Step#2: Specifying Criterion into the query

With that done, let's select the fields to be added in the criteria. Over here, we will choose the Product code field, name, description, standard cost, and the discontinued field.

Under the discontinued field, in the Criteria section, just type "yes" against the criteria field, and then run the query.

A table would be populated showing only the Discontinue products.

Step#3: Using criterion differently

What if we want to see the records of the products which are not discontinued? For that we will use the "No" query here.

For that, open the query table and right click on Query Tab and select the Design View option.

Now just remove the check mark under the 'Discontinued' field and then change the criteria from Yes to No.

Once done, run the query. A table will be populated displaying all the products which are not discontinued.
Рекомендации по теме
Комментарии
Автор

❗ Subscribe To Our Main YouTube Channel

howtechoffice
Автор

Thank you this video actually helped me in my assignment today. Thanks a lot

vanishaprakash
Автор

I have an assignment for a computing class I'm in using Access, and I have to set criteria using the Yes/No box. Do you have any other videos for other scenarios or rules using this field?

datreal
Автор

Good morning sir and thank you for the video. I am trying to get user input by using the criteria section. I tried: Like [enter yes or no]. When the user enters yes or no, it is not giving any records. I am not sure what am I doing wrong. Any suggestion please?

GeoRaad
Автор

When you apply the query this way it creates a bunch of ()'s and []'s in the SQL code. If you switch to SQL view and remove all of those it still all works perfectly. It's just a bit neater to my eye. Good video though thanks for the help.

thecalcium
Автор

I have a situation where I have 3 different list boxes, all listing 3 different queries that have True and False field criteria. 2 of them work, and one of them does not work. This is inconsistent behavior of MS Access. At one point, one of the other list boxes was not working either, by some chance it started working after changing the display control property to Check Box, but this doesn't work for other list boxes. This is weird and non-productive. I just have to keep opening and saving hoping something different will happen. Because that worked for me the first time I fixed it.

davidanthony
Автор

How to get it from visual basic's query builder?
Anyone know about it?

AkilMoretti
Автор

please do not let them miss day his speech doing good

wilmajmayfield
Автор

i fucking hate this assignment just grade my shit already give it a 0 I DONT CARE

cokedupcat
Автор

were is your brother ken and jinx how is thy doing tell miss lexi hi and your daughter please keep your eyes open no slow it down money do go fast slow down man hey you have medical insurance for your all three kids put the twin in school all day preschool get them ready please watch who you let in your circle everybody got there hand out just be careful please

wilmajmayfield