How to display multiple IIf results in one column

C

Charlotte

I have a simple query for one table that I need to display different
results on multiple rows, but within the same column for several
fields. The below example I am trying is not working:

Result: IIf([field1]=yes, “abc”, IIf([field2]=yes, “xyz”))

I would like the query to display the following on two separate rows:
Result:
abc
xyz

What is the best method to achieve this without having to use a union
join query?

Thank you!
 
J

John W. Vinson

I have a simple query for one table that I need to display different
results on multiple rows, but within the same column for several
fields. The below example I am trying is not working:

Result: IIf([field1]=yes, “abc”, IIf([field2]=yes, “xyz”))

I would like the query to display the following on two separate rows:
Result:
abc
xyz

What is the best method to achieve this without having to use a union
join query?

Thank you!

I'm not sure I understand the logic. What if field1 and field2 are BOTH yes?
What's the structure of your table and where (other than buried in
hard-to-read code) are the translations?

If you want to start with a Query with a single record, and generate an output
that contains multiple records, you will need either a UNION query or some VBA
code; but if you can explain the existing table situation and the business
problem you're trying to solve, someone should be able to suggest a solution.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

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