View Full Version : if statements - converting boolean "yes" to male in gender column


saleemMSMS
11-25-2009, 10:17 PM
hi i have a student table it has this gender column. it saves males as '1' and female as '0'
i want to write a query to display all the '1' as "MALE" and '0's and "FEMALE"
how can i do this in Access Queries ???:eek::eek:

JANR
11-25-2009, 10:43 PM
If you right click on the field in question in the query to get the property of the field, and change it to textbox. Then you write this in the format property:

;"Male";"Female"

If you get a syntax error, replace ; with , It has to to with regionalsetting on your system.

JR

John Big Booty
11-25-2009, 11:13 PM
With your query in design view put the following in a new column in the Field Row (Top row);
Expr1: IIf([Gender]=1,"Male","Female")
When you run the query you will get a column headed Expr1 which will return either Male or Female, you can change Expr1 to almost anything so long as it doesn't conflict with any other field in your query.