I have created a Microsoft Access 2007 database to store basketball statistics. I have 3 tables: Players (all player info), Games (all game info), and Stats (all the data pertaining to players and games). I have a Game ID, a Player ID, and a Stat ID, which are all primary keys to their respective tables. The Game ID and Player ID are foreign keys in the STATS table. I have managed to use queries to obtain averages (fg%, ft%, etc). The problem I am having now is trying to obtain totals. For example, I can display a player's stats for each game, but I cannot get the totals. I have tried using the SUM and COUNT functions but have had no luck thus far. Also, since I cannot get the totals, I cannot figure out points per game, because I need the total points and to divide by the number of games. If anyone can help me figure out how to get the TOTAL or SUM of the values in a column (Field) then I should have all the necessary info to finish this. See exaple below:
Game # - - - Player - - -Points
----1--------Joe Smith-----12
----2--------Joe Smith-----16
----5--------Joe Smith------9
----8--------Joe Smith-----11
I need the COUNT for the Game # field (which would be 4) and the TOTAL or SUM of the Points field (which would be 48). Then I could take the TOTAL or SUM and divide by the COUNT to get points per game.
Please tell me what I should do to get this, as it seems like it should be a very simple task, yet one that is giving me a lot of grief
This post has been edited by lightningrod66: 19 Jun, 2009 - 09:01 AM