Simple query question in MS Access.?

I am using MS Access to create this database and making a query that will show my score of the winning team and the name of the winning team. This is what my tables currently look like in Access:

http://i50.tinypic.com/scf1av.jpg

To create the winning score I want to use:

max(homeScore, awayScore)

And to show the winning team I want to use:

IIf(homeScore>awayScore, [homeTeam.name], [awayTeam.name])

Where do I put these expressions in the query? I tried to put them in the field but this is not working for some reason.

Thanks

2 Answers

Relevance
  • 10 years ago
    Best Answer

    select * from game

    inner join hometeam on game.homeTeamID=homeTeam.teamid

    inner join awayteam on game.awayTeamID=awayTeam.teamid

    where homeScore>awayScore

    select * from game

    inner join hometeam on game.homeTeamID=homeTeam.teamid

    inner join awayteam on game.awayTeamID=awayTeam.teamid

    where homeScore<awayScore

  • 3 years ago

    oftentimes. no longer continuously directed on the guy i'm chatting with yet somewhat, somebody that they had have talked to me approximately. many circumstances it is suited precise here on Yahoo suggestions. it is in many circumstances collectively as somebody is appearing "unbalanced". Making verbal or incredibly threats, etc.. that would desire to be a Prozac us of a.

Still have questions? Get your answers by asking now.