select records on yes/no fields

B

Bob Brannon

Hello,

I am using Access 2000. Can anyone tell me how to specify a criteria in a query that selects records from a "Yes/No" field that have an answer of "Yes" (or 1, or when one looks at the query, a box with a check in it)?

Regards,
Bob Brannon
 
E

Eric D via AccessMonster.com

0 or "NO"
1 or "YES"

Bob said:
Hello,

I am using Access 2000. Can anyone tell me how to specify a criteria in a query that selects records from a "Yes/No" field that have an answer of "Yes" (or 1, or when one looks at the query, a box with a check in it)?

Regards,
Bob Brannon
 
B

Bob Brannon

Sorry for the trouble, I already figured it out, thanks anyway.

Hello,

I am using Access 2000. Can anyone tell me how to specify a criteria in a query that selects records from a "Yes/No" field that have an answer of "Yes" (or 1, or when one looks at the query, a box with a check in it)?

Regards,
Bob Brannon
 
P

peregenem

Eric said:
0 or "NO"
1 or "YES"

I prefer to test for 'not zero'

CREATE TABLE Test (
key_col INTEGER NOT NULL UNIQUE,
data_col YESNO DEFAULT 0 NOT NULL
)
;
INSERT INTO Test VALUES (1,0);
INSERT INTO Test VALUES (2,1);
INSERT INTO Test VALUES (3,2);
INSERT INTO Test VALUES (4,999);

SELECT key_col, data_col
FROM Test
WHERE data_col <> 0;
 
Top