problem with query

D

dshemesh

Hello,
I have the following problem:
I have a table with field1, filed2, field3. I want to create a query which
will return 2 fields out of the 3 dynamically. For example I want the first
field of the query to allways be field1, but I want the second field of the
query to be field2 if field1 equals 1, and I want it to be field3 otherwise.
I tried using:
IIF(field1=1, field2, field3)
but the computer prompts me for field2. Any suggestions?

thank you
 
R

Rick B

Did you put this in a new column in your query? Did you give it a name?
You should have the following in a new blank column...

SomeNewFieldName: IIF(field1=1, field2, field3)
 

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