Results 1 to 3 of 3
  1. #1
    pdonoho is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2023
    Posts
    1

    fantasy sports records and scores database

    aloha all!



    i have a fantasy football league now in it's 33rd year. i have all the records for all the head to head games through those years and want to create a database where i can quickly query any number of reports based on that data. some examples would be, basic win/loss/tie records for any given year for any given team; w/l/t records for one team versus another team over a range of years or all years; total points scored for and against; points one team scores against another team over a range of years or all years, etc...

    right now i have all of this data stored in an excel spreadsheet and it looks like the following. i have my column headers and then a section of a few sample weeks/games shown here. "wktype" is regular season versus playoffs, "bowl" is what round of the playoffs that game was (so a blank entry for regular season game). "teamffl" and "pf" is one team and their score that week; "opp" and "pa" is their opponent and their score that week. it seems like i should be able to have the database then determine that for instance in week 14 of the regular season DID beat ABP4B 37 to 35 so it's a win for DID and a loss for ABP4B and based on that each teams overall records can be compiled based on any number of possible queries stated above.

    YEAR WKTYPE WEEK TEAMFFL PF PA OPP BOWL
    2022 RS 14 DID 37 35 ABP4B
    2022 RS 14 HFJ 58 68 MM
    2022 RS 14 GDL 58 62 BRW
    2022 PL 15 CFB 46 54 FCJ FR
    2022 PL 15 BFM 49 50 Chefs FR
    2022 PL 15 HFJ 43 36 BRW FR
    2022 PL 15 DID 77 62 MM FR
    2022 PL 16 Chefs 62 48 FCJ FBCS
    2022 PL 16 HFJ 39 74 DID FBCS

    note, i'd be willing to pay someone to create this awesome database for me :-)

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Review https://www.reddit.com/r/fantasyfoot...cess_database/

    Working with your sample data in Access, consider:

    Query1:
    SELECT ID, Year, WKTYPE, Week, TeamFFL, PF, PA, OPP, Bowl, IIf([PF]>[PA],[teamffl],[opp]) AS Team, "Win" AS Status FROM FFLGames
    UNION SELECT ID, Year, WKTYPE, Week, TeamFFL, PF, PA, OPP, Bowl, IIf([PF]<[PA],[teamffl],[opp]), "Loss" FROM FFLGames;

    Query2:
    TRANSFORM Count(Query1.ID) AS CountOfID
    SELECT Query1.YEAR, Query1.Team
    FROM Query1
    GROUP BY Query1.YEAR, Query1.Team
    PIVOT Query1.Status;

    Year Team Loss Win
    2022 ABP4B 1
    2022 BFM 1
    2022 BRW 1 1
    2022 CFB 1
    2022 Chefs
    2
    2022 DID
    3
    2022 FCJ 1 1
    2022 GDL 1
    2022 HFJ 2 1
    2022 MM 1 1

    More about CROSSTAB query http://allenbrowne.com/ser-67.html
    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
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi
    Can you upload your database?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

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

Similar Threads

  1. How to design my sports database
    By chemmiah in forum Database Design
    Replies: 1
    Last Post: 06-12-2014, 11:13 AM
  2. Sports Database
    By itsfaz in forum Access
    Replies: 1
    Last Post: 04-02-2014, 12:52 PM
  3. How to list sports scores in a database
    By chemmiah in forum Database Design
    Replies: 1
    Last Post: 11-21-2012, 03:53 PM
  4. Sports Team database
    By Patriot7470 in forum Database Design
    Replies: 2
    Last Post: 03-17-2012, 01:50 PM
  5. Help with Sports database
    By sportinus in forum Database Design
    Replies: 0
    Last Post: 03-16-2010, 09:00 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