Results 1 to 4 of 4
  1. #1
    jbessling is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2011
    Posts
    1

    Database layout issues


    I am new to Access and I am trying to build a DB for fantasy football stats. I created a table labeled GAMES, and I have these fields:
    Season, week#, home team, home team points, away team, away team points, score, winner

    I also have another table for TEAMS, so that the team names are referenced in a drop-down menu on the GAMES table.

    The issue(s) that I am running into are that I want to be able to sort each week of each season and filter out the team with the Highest Point Value that week overall. In addition, I would like to be able to tally up the number of weeks that each team had the Overall Highest Point Total. Or for that matter, can I create a team's season record from this table? I would like to then display all of the teams' records created from this database. That way I could compare records, win-streaks, lose streaks, home record, away record, etc.

    I would also like to attach the point total each week to their respective team. But sometimes the team is an away team and sometimes they are home. How can I (if this is the proper way to do it) make a relation with two fields in the same table. For instance, I want to see how many points the "Gridiron Grunts" have scored in a given season, then how do I associate the [Home Team] field with the [Home Team Points] in the same table?

    Perhaps I need to be creating more tables? If someone has a template of something similar to this, I would love to get a copy. I don't know how to deal with head-to-head scoring and records. Its completely different than all the help options give which are primarily "Customer A" buy "Product X" "X amount of times", etc....

    Sorry I have asked so many questions in one posting. But I think if I can learn to do a couple of these calculations then the rest should follow similar guidelines.

    Thanks so much for any advice!

    Jeff

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Normalizing the score data will make some analysis easier. There would be two records for each game.

    tblScores
    GameID
    TeamID
    Side (home, away)
    Points

    What are the score and winner fields for? Can't those be determined by the Points? This normalization does make it harder to compare the point values for each game but it is easier to add up points by team.

    So if this restructuring is not desirable, then use of UNION query is one way to do the summary calcs you describe. A UNION essentially results in a data structure like the normalization I describe. There is no designer or wizard for UNION, must type into the SQL view of query designer. Like:

    SELECT Season, [week#], "Home" As Side, [home team] As Team, [home team points] As Points, score, winner FROM table
    UNION SELECT Season, [week#], "Away", [away team], [away team points], score, winner FROM table;

    Now can use this query as source for the summary calcs.

    BTW, advise not to use special characters, spaces, punctuation (underscore is exception) in names. Better would be weekNum, home_team.
    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
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    I agree with June7 - rather than a column [field] for home and away, have one column for side and record a value for 'h' or 'a' which could be a foreign key or just a value you expand on later with an iif statement.

  4. #4
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    great project - let me know if you want any further help

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

Similar Threads

  1. Print Layout
    By Mxcsquared in forum Forms
    Replies: 4
    Last Post: 10-30-2013, 11:40 AM
  2. Database Design/Report Issues
    By j2curtis64 in forum Access
    Replies: 15
    Last Post: 07-08-2011, 08:00 AM
  3. Database performance issues
    By smikkelsen in forum Access
    Replies: 3
    Last Post: 03-10-2011, 05:53 PM
  4. Risk/Issues Database
    By glassarchitect in forum Database Design
    Replies: 1
    Last Post: 12-01-2010, 09:17 AM
  5. Replies: 3
    Last Post: 08-31-2010, 12:44 PM

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