How to display multiple IIf results in one column

  • Thread starter Thread starter Charlotte
  • Start date Start date
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!
 
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
 
Back
Top