Query Problem

D

Debbie

I have a word merge, trying to merge from my field 'GENDER' which
holds the either Male or Female. In the word document, I have to ask
the question twice. I have an M and an F and want an X to show up
next to the proper letter.
If Male then X otherwise blank. M
If Female then X otherwise blank F
I want the X to go in front of the letter of which ever the gender is
and the other to be blank.

In my query I have two fields:
FEMALE: IIf([Gender]=[FEMALE],"X","")
MALE: IIf([Gender]=[FEMALE],"","X")
When I close the design view, this message comes up.
Circular reference caused by alias 'FEMALE' in query definition's
SELECT list.

What am I doing wrong and how can I fix it to ask the question twice?
 
D

Debbie

I have a word merge, trying to merge from my field 'GENDER' which
holds the either Male or Female.  In the word document, I have to ask
the question twice.  I have an M  and an  F and want an X to show up
next to the proper letter.
If Male then X otherwise blank.  M
If Female then X otherwise blank F
I want the X to go in front of the letter of which ever the gender is
and the other to be blank.

In my query I have two fields:
FEMALE: IIf([Gender]=[FEMALE],"X","")
MALE: IIf([Gender]=[FEMALE],"","X")
When I close the design view, this message comes up.
Circular reference caused by alias 'FEMALE' in query definition's
SELECT list.

What am I doing wrong and how can I fix it to ask the question twice?

sorry, i typed wrong, it says:
FEMALE: IIf([Gender]=[FEMALE],"X",""), which I was going to use for
the questions next to the F
MALE: IIf([Gender]=[MALE],"X",""), which I was going to use for the
questions next to the M
 
D

Debbie

I have a word merge, trying to merge from my field 'GENDER' which
holds the either Male or Female.  In the word document, I have to ask
the question twice.  I have an M  and an  F and want an X to show up
next to the proper letter.
If Male then X otherwise blank.  M
If Female then X otherwise blank F
I want the X to go in front of the letter of which ever the gender is
and the other to be blank.
In my query I have two fields:
FEMALE: IIf([Gender]=[FEMALE],"X","")
MALE: IIf([Gender]=[FEMALE],"","X")
When I close the design view, this message comes up.
Circular reference caused by alias 'FEMALE' in query definition's
SELECT list.
What am I doing wrong and how can I fix it to ask the question twice?

sorry,  i typed wrong, it says:
FEMALE: IIf([Gender]=[FEMALE],"X",""), which I was going to use for
the questions next to the F
 MALE: IIf([Gender]=[MALE],"X",""), which I was going to use for the
questions next to the M- Hide quoted text -

- Show quoted text -

Nevermind, thanks anyway. I figured it out.
FEMALE: IIf([Gender]="Female","X","")
MALE: IIf([Gender]="Male","X","")

I needed quotes around Female and Male.
 

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