Results 1 to 6 of 6
  1. #1
    dniezby is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2013
    Posts
    183

    How do I create a running total


    Okay, I hope I can clarify this correctly.

    Im designing a poker tournament and membership manager and I don't know how to approach a feature I need.

    I have a table -EVENTS that contains the core event data like the date, location and attendance.

    Then I have a separate table that links to the event's KEY and is used to store the events results. Player name (pulled from member table), finish position and points. Players are awarded points for where they finish a game. I want those points to be added to The members overall point total.

    Any thoughts on how I add these points to a total and where do you think I should store the running total? Should it always be calculated in a query or stored in a field? I'm so lost right now any help would be greatly appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Don't store running total, this should be calculated. Not sure what you mean be 'added to members overall point total'. How is overall point total determined?

    A running total in a query is not easy.
    http://support.microsoft.com/kb/290136
    http://www.techrepublic.com/article/...-query/6140569

    Textbox on report has a RunningSum property.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    dniezby is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2013
    Posts
    183
    Imagine this. Think like your in a Dart league. For every game you play, the player gets 20 points. For every place that player takes he gets additional points. Let's say our player took 1st today, Took 3rd yesterday and 5th on Tuesday. He was awarded 400 points for the first play, 140 for third and 90 points for the 5th place. Now after each one of those "events" my user will select the player by name and enter their finish position along with points (unless I can figure out how to calculate those as well) Anyway, after each event, that total will be added to the player's total pool of points. When a player looks up their account, it should show "Your current point total". They will then use those points like currency; so I will have to subtract points from them as well.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Each of those places is a separate record in table?

    Not sure what you need is running sum, might be you need an aggregate calculation. Aggregate calcs can be done with a Totals query using GROUP BY criteria. Can also build a report using Grouping & Sorting features with aggregate calcs in group sections.

    If data saved is finish position then the points could be calculated, assuming the point value for each position is standardized.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    dniezby is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2013
    Posts
    183
    June7, thanks for your input.
    The points players earn when playing games can be used to purchase perks. So, when the points are awarded in the event, they need to also be added to the "player's total" When a player looks up their account, they should see all of their additions and the points they've paid out.

    Here is a copy of my application with some dummy info in it.

    Obviously, it's still in the designing phase so I don't have all the forms I will eventually be using. But here is a typical flow through the system.

    A new player comes to the league, we go to Member Registration Form.

    We're going to start a new game, we open, the Event Form.
    When the game is over, we enter the players finish positions, select or enter their ID number, then enter (eventually automatically entered) player point awards.

    Those totals get added to the player's overall grand total.
    The player goes home, looks at his / her account and see x number of points

    Hopefully the database will make things a little more clear.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Since ID field in Player table is the primary key, the Player field in event_results table must be number type, not text. Then set link between them in Relationships.

    Ideally, would not save aggregate data. Calculate the net difference of points awarded and points used. This means two aggregate (Totals) queries with grouping on player ID - one to total points earned and one to total points used. Then join those two queries to the Players table. Create a field in query (or do calcs in textbox on report) that subtract used from earned.

    I don't see a table for transactions of points used.

    You might consider not saving ID value as pk/fk for the lookups, such as the player_Status. Since the status descriptor is short, I recommend just saving the text descriptor. This eliminates lookup aliases and joining tables in queries to retrieve the descriptor. I doubt this will cause db to get too large.

    Recommend no spaces in names (tables, fields, queries, forms, reports).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Running Total Query??
    By kwooten in forum Queries
    Replies: 8
    Last Post: 06-15-2012, 06:10 AM
  2. Running Total (Cumulative)
    By jamesborne in forum Queries
    Replies: 3
    Last Post: 12-26-2011, 09:30 PM
  3. Running total
    By lololthis in forum Queries
    Replies: 5
    Last Post: 06-21-2011, 04:14 PM
  4. Running Total in Subform
    By Scorpio11 in forum Forms
    Replies: 19
    Last Post: 07-03-2010, 05:44 PM
  5. Using running total in query to create graphs
    By maggioant in forum Queries
    Replies: 4
    Last Post: 10-02-2009, 05:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums