Emulate A Nested If?

J

Jeff

I am trying to convert an Excel spreadsheet to an Access database. In
the spreadsheet, I use a nested IF statement to return one of three
results by comparing two values:

=IF([TeamScore]>[OpponentScore],"WIN",IF([TeamScore]<[OpponentScore],"LOSS","TIE"))

Can anyone provide insight into how I might accomplish a similar task
in an Access query? So far, I've been able to closely emulate the
spreadsheet in the database by establishing a field in a query with an
IFF expression, but I can only return one of two results, rather than
three:

RESULT: IIF([TeamScore]>[OpponentScore],"WIN","LOSS")

Any thoughts? Thanks in advance!
 
C

Cameo

Nested IFs work in Access as well, you just need to make sure you have all
the IIFs with two I's. I would look for a typo if it's not working.

Cameo
 
J

Jeff

Thanks, Cameo! You're right; I must have been coding it incorrectly,
as it seems to work now. Thanks again!

Nested IFs work in Access as well, you just need to make sure you have all
the IIFs with two I's. I would look for a typo if it's not working.

Cameo

Jeff said:
I am trying to convert an Excel spreadsheet to an Access database. In
the spreadsheet, I use a nested IF statement to return one of three
results by comparing two values:

=IF([TeamScore]>[OpponentScore],"WIN",IF([TeamScore]<[OpponentScore],"LOSS",
"TIE"))

Can anyone provide insight into how I might accomplish a similar task
in an Access query? So far, I've been able to closely emulate the
spreadsheet in the database by establishing a field in a query with an
IFF expression, but I can only return one of two results, rather than
three:

RESULT: IIF([TeamScore]>[OpponentScore],"WIN","LOSS")

Any thoughts? Thanks in advance!
 

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