Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    Join Date
    Apr 2017
    Posts
    1,792
    Create a saved query, p.e. qGradesTotal

    Code:
    qGradesTotal = 
    SELECT test.Term, test.Last, test.First, SUM(Iif(test.Grade < "D",1,0))  AS Passed, SUM(Iif(test.Grade >= "D",1,0))  AS Missed
    FROM TblHotWaterTest_2 test
    GROUP BY test.Term, test.Last, test.First;
    Now you can query
    SELECT * FROM qGradesTotal WHERE Passed >= 3


    or
    SELECT * FROM qGradesTotal WHERE Passed < 3

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    So count FA as failure and ignore the W?

    Change the criteria to: [Grade] LIKE 'F*'
    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. #18
    Dean0_53 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    30
    Oh, Sorry about that. We do have a unique identifier call a PIDM. I added it with fake numbers. Each student has a PIDM different that a SSN number. Hope this helps.
    Attached Files Attached Files

  4. #19
    Dean0_53 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    30
    I have to sign off for now. Thanks again for your help!

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Well, use the PIDM in place of the [Last] & [First].
    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.

  6. #21
    Dean0_53 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    30
    How would I use PIDM instead of name? Thanks!

    SELECT test.PIDM_KEY AS Pidm, test.LAST_NAME AS [Last], test.FIRST_NAME AS [First], test.SUBJ_CODE, test.CRSE_NUMBER, test.GRDE_CODE_FINAL AS Grade, Sum(IIf([test].[Grade]<"D",1,0)) AS Passed, Sum(IIf([test].[Grade]>="D",1,0)) AS Missed
    FROM test
    GROUP BY test.PIDM_KEY, test.LAST_NAME, test.FIRST_NAME, test.SUBJ_CODE, test.CRSE_NUMBER, test.GRDE_CODE_FINAL
    ORDER BY test.LAST_NAME, test.FIRST_NAME;

  7. #22
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Well, using suggestion from post 14, suppose I meant like:

    SELECT TblHotWaterTest_2.*
    FROM TblHotWaterTest_2
    WHERE PIDM In (SELECT PIDM FROM TblHotWaterTest_2 GROUP BY PIDM HAVING Sum(IIf([Grade]="F",1,0))>=3)
    ORDER BY [Last] & [First];
    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.

  8. #23
    Dean0_53 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    30
    Hello June 7,

    You have been very helpful and we're getting very close. I do have a few more questions. Is there any way to get all the bad grades to sum? So if a student has anything below a F, (FA, W, I) they will all sum together? I have attached a new copy of the database. When I run the QryMissed, the total aren't quite correct. The missed grades total don't match up with the grade table. Bobby Brady doesn't have any missed grades.

    Thanks again for all your help!

    DeanO
    Attached Files Attached Files

  9. #24
    Dean0_53 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    30
    I won't let me add another file. Is it because there are other files already attached?

    Thanks

  10. #25
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Should be able to add another file. Or if you can still edit your post, replace file.
    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.

  11. #26
    Dean0_53 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    30
    I zipped the file, but I don't know if it attached.
    Grade Test.zip

  12. #27
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    It attached. Don't see PIDM field anywhere.

    The expression fails because D sorts as less than D-, C < C-, etc.

    Why are you bothering with MAKE TABLE? Just use a query to produce the data. Modify Query1:

    SELECT test.Term, test.Last, test.First, Sum(IIf([test].[Grade] Not In ("D-","F"),1,0)) AS Passed, Sum(IIf([test].[Grade] In ("D-","F"),1,0)) AS Missed
    FROM TblHotWaterTest_2 AS test
    GROUP BY test.Term, test.Last, test.First;
    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.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-26-2016, 01:07 PM
  2. Replies: 2
    Last Post: 01-27-2016, 08:38 AM
  3. Replies: 6
    Last Post: 06-09-2015, 09:51 AM
  4. Replies: 3
    Last Post: 04-28-2015, 02:16 AM
  5. Replies: 0
    Last Post: 02-25-2013, 04:43 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