Results 1 to 3 of 3
  1. #1
    Sam is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2022
    Posts
    50

    subquery

    Click image for larger version. 

Name:	scrn.jpg 
Views:	13 
Size:	55.2 KB 
ID:	49201

    I'm trying to run a query on the above table to eliminate the duplicates.


    Even if 1 out of the 3 fields is unique, it should be listed. Only if all 3 are duplicates, it need not be in the list.
    I have tried the DISTINCT, WHERE and GROUP BY statements. Alas, no success.

  2. #2
    Sam is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2022
    Posts
    50
    Well, I could manage that by removing the ID field and setting the Properties - Unique Values to Yes.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Don't think I'd do that if you're talking about prevention. The best prevention would be a composite index (probably 3 fields, not including ID autonumber if that's what you have).
    As for removal, try using the Find Duplicates query wizard to create a base query of dupes that you can delete from. If memory serves, you leave out the ID field in such a query.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Subquery
    By diegomarino in forum Access
    Replies: 3
    Last Post: 05-22-2022, 09:01 AM
  2. A subquery inside a subquery
    By tbjmobile@gmail.com in forum Queries
    Replies: 15
    Last Post: 04-22-2018, 11:48 AM
  3. Subquery Help
    By MTSPEER in forum Queries
    Replies: 1
    Last Post: 12-05-2017, 01:57 PM
  4. Subquery
    By Daryl2106 in forum Access
    Replies: 20
    Last Post: 01-13-2013, 07:21 AM
  5. TOP subquery
    By helpaccess in forum Queries
    Replies: 5
    Last Post: 08-30-2011, 10:28 AM

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