• How to Create Unique List out of Duplicate List

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » How to Create Unique List out of Duplicate List

    Author
    Topic
    #460217

    Say we have a table tblParts
    ABC
    ABC
    ABC
    DEF
    DEF

    How to create a query of unique list based upon the above table?
    ABC
    DEF

    Viewing 1 reply thread
    Author
    Replies
    • #1162909

      Hi Armstrong,
      The unique list can be created by following the steps:
      1. In the Design View, press Totals button;
      2. In Total grid field, choose group by.

      Then the query will create a unique list.

      Armstrong

    • #1162910

      Set the Unique Values property of the query to yes. This corresponds with changing the SQL to
      Select Distinct ….

      In Query Design, display the properties box, the click some empty space in the top half of the grid, so the Properties box tells you about the query, rather than one of its fields.

      • #1162914

        Hi John,
        Thanks for your help.
        The actual tblParts are rather complex and the PartNo repeats freely. That’s exactly where I find your Property sheet won’t work in my case.
        The combination of PartID (based on autonumber) and PartNo always render each record unique. The objective here is to create a list of unique PartNo.
        Armstrong

        • #1162919

          If you just want to create a list of unique PartNos, you shouldn’t include PartID in the query, only PartNo. Setting “Unique Values” to Yes will then ensure that each PartNo occurs only once.

          If you want to do more, for example count the number of occurrences of each PartNo, you need a Totals query that groups by PartNo. But that wasn’t what you asked in the first post in this topic…

          • #1162921

            Hi HansV,
            I couldn’t thank enough for your help. Your guide works brilliantly. Yes, selecting PartNo only and setting Unique Values property to Yes succeed to generate a list of unique PartNos.
            Thanks again.
            Armstrong

    Viewing 1 reply thread
    Reply To: How to Create Unique List out of Duplicate List

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: