Like [yes or no*]

nigel brown

Registered User.
Local time
Today, 14:59
Joined
Dec 7, 2010
Messages
43
Hi

I am struggling with this one!

Hi have a query that has two criteria, one is Like[candidate surname*], and the other is Like[ yes or no*].

The yes/no does not work when is put either yes or no in the search dialogue box when I run the criteria.

The yes no field is a yes no field in the table.

Please help

Regards

Nigel Brown
 
If the field is a Yes/No (Boolean) field type then using Like Yes or No is not the correct syntax. This is because the values can only be Yes or No. You might argue that it could be Null - what is known as tripple state. so if you want to check for Yes's and No's then you need to use Is Not Null

However if you have a default value in your field properties for new records and this is set to either True or False then you will not be using tripple state.
 
If the field is a Yes/No (Boolean) field type then using Like Yes or No is not the correct syntax. This is because the values can only be Yes or No. You might argue that it could be Null - what is known as tripple state. so if you want to check for Yes's and No's then you need to use Is Not Null

However if you have a default value in your field properties for new records and this is set to either True or False then you will not be using tripple state.


Using either "yes" or "no" in the criteria, returns the correct results. Is not null does not return the correct result.

So there is no way to select either yes or no, without amending the query?

Thanks
 
If you want to return both Yes and No you need

In(Yes,No)
 
If you want to have a Yes, No and Null then you need to create your own Yes/No or Boolean field using something like the Byte data type. Then restrict the values to 0 for No, 1 for Yes and if not filled in it will be Null.

Then you can test for Null in your query using Is Null.

Obviously this means that you will also need to interpret those values to Yes/No in your reports and forms if you don't want the users seeing 0s and 1s.
 

Users who are viewing this thread

Back
Top Bottom