School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,368 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,449 people online right now. Registration is fast and FREE... Join Now!




Counts and Totals of columns

 

Counts and Totals of columns, Obtaining number of items, and total (sum) of items in a column

lightningrod66

19 Jun, 2009 - 08:57 AM
Post #1

New D.I.C Head
*

Joined: 27 May, 2009
Posts: 3

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 sad.gif

This post has been edited by lightningrod66: 19 Jun, 2009 - 09:01 AM

User is offlineProfile CardPM
+Quote Post


June7

RE: Counts And Totals Of Columns

19 Jun, 2009 - 02:14 PM
Post #2

D.I.C Regular
Group Icon

Joined: 9 Dec, 2008
Posts: 476



Thanked: 37 times
My Contributions
Build a report and use Grouping/Sorting settings with calcs.
In report design view, right click over header or detail section and select Sorting and Grouping.
You can use the tables directly or queries as the record source for report.

This post has been edited by June7: 19 Jun, 2009 - 02:19 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 08:54PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month