Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Enter Parameter Value" Error In Simple Query (MS Access)

Status
Not open for further replies.

gamingmouse

Programmer
May 26, 2006
7
US
The "game_players" table contains poker data. Each "game_id" is repeated for as many players happened to be in that game, or hand.

If a player saw the flop, then the field "saw_flop_n" = 1; if not, it equals 0. I'm trying to get all game_id in which exactly two players saw the flop:
Code:
SELECT Sum(saw_flop_n) AS [num_saw_flop], game_id
FROM game_players
WHERE num_saw_flop = 2
GROUP BY game_id;

But when I run the query above, Access asks me to "Enter Parameter Value" for num_saw_flop. What is wrong with the query above?

Thanks,
gm
 
SELECT Sum(saw_flop_n) AS num_saw_flop, game_id
FROM game_players
GROUP BY game_id
HAVING Sum(saw_flop_n) = 2

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes. Thank you.

Also, if I am interested ONLY in games in which I was one of the players, how could I do this?

Each row also has a "player_id" field -- and for each group of "game_id" every "player_id" is unique. The problem is that I cannot simply add

"WHERE player_id = 12"

because player_id is not an aggregate function. Do I have to do a query of a query?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top