Yes or No

R

Robert Smith

I have a field that I want to query. The input is Yes or No. I'm trying to
find an Iif statement that will do it.
 
J

John W. Vinson

I have a field that I want to query. The input is Yes or No. I'm trying to
find an Iif statement that will do it.

Robert, you'll need to post more context than that. What does an IIF
statement have to do with a query? Is the field a Text field containg the
literal text strings "Yes" and "No", or an Access Yes/No field (actually
stored as -1 for Yes, 0 for No), or are these the user's input, or what?

What do you have in the database, and what specifically are you trying to
accomplish?
 
A

Allen Browne

Robert Smith said:
I have a field that I want to query. The input is Yes or No. I'm trying to
find an Iif statement that will do it.

1. In query design view, enter the prompt you want into the Criteria row
under your yes/no field. Put the name in square brackets, e.g.:
[TrueOrFalse]

2. Inform Access that this is a true/false value. Choose Parameters on the
Query menu, and enter this row in the dialog:
[TrueOrFalse] Yes/No

The query will now prompt you for the value, and accept only true or false
values. The user can enter No, False or 0, or Yes, True, or -1.

You will end up with a query that shows something like this in SQL View:
PARAMETERS [TrueOrFalse] Bit;
SELECT MyTable.MyYesNo
FROM MyTable
WHERE MyTable.MyYesNo = [TrueOrFalse];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top