Emulate A Nested If?

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