Replace true / false with string

G

Guest

I have a table with a true / false field. In my query results I don't want
true / false, I want "Member" or "Guest".

Working with other SQL products there was a way to use an "X" (or any place
holder) in the Select statement and then define X in the Where statement, If
member(column name) = True, "Member" else "Guest"

Is there a similar function in access?

Thanks
 
J

John Vinson

I have a table with a true / false field. In my query results I don't want
true / false, I want "Member" or "Guest".

A couple of ways: one would be to put a calculated field in the query:

Iif([fieldname], "Member", "Guest")

Or, set the Format property of the field to:

"";"Guest";"Member";""

This uses the tricky "four value format" - positive, negative, zero
and NULL respectively, and the fact that True is stored as -1, False
as 0.

John W. Vinson[MVP]
 
G

Guest

Thanks John, That should give me enough to work out the details.

John Vinson said:
I have a table with a true / false field. In my query results I don't want
true / false, I want "Member" or "Guest".

A couple of ways: one would be to put a calculated field in the query:

Iif([fieldname], "Member", "Guest")

Or, set the Format property of the field to:

"";"Guest";"Member";""

This uses the tricky "four value format" - positive, negative, zero
and NULL respectively, and the fact that True is stored as -1, False
as 0.

John W. Vinson[MVP]
 

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