Share via

Do Not Show Multiple Values in a Query

Anonymous
2017-06-22T14:39:16+00:00

Hello

I have a query with the following results:

ID Category
1 Alpha
2 Beta
2 Beta
2 Beta
3 Alpha
3 Gamma
3 Alpha

I WANT the results below:

ID Category
1 Alpha
2 Beta
3 Alpha
3 Gamma

basically, I have an ID Number linked to an incident that can include multiples of different categories. I want my query to ignore the duplicate Categories. I feel like Ive been here before, but I not able to find prior examples of it in my work.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2017-06-22T16:37:22+00:00

    Thank you. I remembered that property setting. I wasnt sure what exactly it would do.

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,830 Reputation points Volunteer Moderator
    2017-06-22T15:50:11+00:00

    Group By is used when you have an aggregate column. If you do not have an aggregate column then you use SELECT DISTINCT. If you open the Properties Dialog for the query there is a choice for Unique Values which you would set to Yes.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2017-06-22T15:18:08+00:00

    I wouldn't use GROUP BY in such a case.

    Instead, in design mode, set the Unique Values property to Yes.  Then run your query.

    What does this do exactly.  You original query SQL Statement would be something along the lines of

    SELECT ID, Category FROM YourTableName;

    by changing the aforementioned property, the SQL statement will switch to

    SELECT DISTINCT ID, Category FROM YourTableName;

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2017-06-22T14:46:47+00:00

    So I literally just posted this.. but I may have figured it out... I just used the "group by" aggregate function and it SEEMS to have worked.... Is this right? Or am I missing something? The only other thing linked to the query is a City. The city stays the same no matter how many different categories are linked to a single ID#...

    Was this answer helpful?

    0 comments No comments