Results 1 to 6 of 6
  1. #1
    rwahdan1978 is offline Advanced Beginner
    Windows 11 Access 2016
    Join Date
    Jun 2024
    Posts
    57

    check query if records are the same


    Hi

    I have a query:

    Code:
    Dim rs As Recordset
            Set rs = CurrentDb.OpenRecordset("select * from users order by score desc")
    I want to check if there are equal scores for all records. Say I have score of 100 3 times and score of 70 for 2 times, I want to know which records have the same score?

    rec 1 score 100
    rec 3 score 100
    rec 7 score 100

    rec 88 score 70
    rec 120 score 70

    how to acheive that?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Sort records by score. Display on form or report.

    If you only want to show records that duplicate a score, i.e. exclude singles, that is another matter and requires nested query. Or some fancy VBA code behind report.
    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
    rwahdan1978 is offline Advanced Beginner
    Windows 11 Access 2016
    Join Date
    Jun 2024
    Posts
    57
    Quote Originally Posted by June7 View Post
    Sort records by score. Display on form or report.

    If you only want to show records that duplicate a score, i.e. exclude singles, that is another matter and requires nested query. Or some fancy VBA code behind report.
    I am making compitition app and i need to check if I have a tie between players then I will make a new round of questions for those who have the same score so i can get the winner.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Doesn't alter my answer.

    Although I expect need more sort criteria, such as EventID, etc. Not knowing your db, hard to say.
    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
    rwahdan1978 is offline Advanced Beginner
    Windows 11 Access 2016
    Join Date
    Jun 2024
    Posts
    57
    Click image for larger version. 

Name:	Untitled.png 
Views:	8 
Size:	5.3 KB 
ID:	51945

    I have this query it getting each score and how many times but I need to include the UserID as well how to do that?

    Click image for larger version. 

Name:	Screenshot 2024-07-05 053912.png 
Views:	8 
Size:	9.8 KB 
ID:	51946

    here is the screenshot, I need to know which userid is having that number?

    Click image for larger version. 

Name:	Untitled.png 
Views:	8 
Size:	2.9 KB 
ID:	51947

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    An aggregate query alone is not going to accomplish. And would only be useful as a nested query to limit results.

    Easiest is to just sort records.

    Or build a report and use its Sorting & Grouping features.

    Or use VBA like http://allenbrowne.com/func-concat.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.

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

Similar Threads

  1. Replies: 3
    Last Post: 10-04-2023, 02:56 PM
  2. Check for Duplicate Records
    By Blackkimba851 in forum Forms
    Replies: 13
    Last Post: 04-01-2019, 04:46 AM
  3. Replies: 1
    Last Post: 07-29-2015, 01:39 PM
  4. Pull Records Since Last Check
    By athyeh in forum Queries
    Replies: 5
    Last Post: 01-09-2014, 10:22 PM
  5. Adding Check box to add more records
    By rondita in forum Forms
    Replies: 2
    Last Post: 07-31-2012, 08:04 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