Results 1 to 6 of 6
  1. #1
    jucooper1 is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2016
    Posts
    18

    Running a query that runs two seperate totals from the same column displayed side by side

    I am a football coach and I am trying to use MS Access for all of my scouting and analysis. For other coaches out there, we do use Hudl, but I am looking for something more powerful, and simpler once set up. Anyway, this is what I am trying to do. I have one table, which is all of the data exported from Hudl (our video software program), edited in excel, then imported into access. Everything is in one table. The specific field I am trying to work with are Week, Opponent, Type (run/pass). What I want to do is run a query that displays The Opponent, with a column (Run) that counts the number of runs from the Type field, and another column (Pass) that counts the number of passes. The Week field is used to sort, but does not need to be displayed. This is what I want it to look like ideally:



    Opponent Run Pass RunPct PassPct
    School1 37 13 74% 26%
    (I keep trying to space this correctly, but it won't let me. Each number should obviously be under its respective column)

    I can get the query to return the result of how many runs each game, or how many passes. I can also get them to display both, in separate rows, but I want it to look like above so I can then total the columns to keep a running count as the season goes on.

    Any suggestions? Not new to Access, but not experienced either.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Something like:

    SELECT Opponent, Sum(IIf(Type = "Run", 1, 0)) As TotalRun, Sum(IIf(Type = "Pass", 1, 0)) As TotalPass
    FROM TableName
    GROUP BY Opponent

    if that works, you can probably create something that comes up with the percentages.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jucooper1 is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2016
    Posts
    18
    That worked! I'll work on the %s and see what I can come up with, but that is less important. Thanks!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem. I don't think the percentages will be hard, post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    jucooper1 is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2016
    Posts
    18
    After showing me how to do the sum, I was able to figure out the percentages. Thanks!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 07-11-2019, 09:43 AM
  2. Replies: 6
    Last Post: 09-10-2017, 08:13 PM
  3. Replies: 11
    Last Post: 06-23-2017, 10:25 AM
  4. Replies: 2
    Last Post: 07-25-2016, 01:12 PM
  5. Report side by side comparing category
    By bbmak in forum Reports
    Replies: 5
    Last Post: 01-12-2014, 12:43 PM

Tags for this Thread

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