Solved

ACCESS

Posted on 2014-12-09
5
195 Views
Last Modified: 2014-12-10
How to find Unique Records in ACCESS
0
Comment
Question by:lux sat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40490379
A little more detail would be helpful?  This isn't a homework assignment, is it?

Are you trying to identify only those records in a table which are unique for one or more fields, or are you simply trying to return a set of records with unique values.  If the latter, you can use the DISTINCT predicate in your SELECT statement:

SELECT DISTINCT Field1, Field2 FROM your Table

Or you might want to use a GROUP By clause:

SELECT Field1, Field2 FROM yourTable GROUP By Field1, Field2
0
 

Author Comment

by:lux sat
ID: 40490388
No it is not hw. but I am new to ACCESS. I need to eliminate Identical rows

Ex.

1  2 3
1 2  3
3 4 5

i just want my result set as
1 2 3
3 4 5
0
 
LVL 84
ID: 40490957
As Dale mentioned, more detail is helpful.

Are those values in the SAME field, or in DIFFERENT fields? How you go about showing distinct records depends greatly on that.

Also, you mention you want to "eliminate" identical rows. Does that mean you want to remove them, or just not show them in your query?

Note that Access includes a "Find Duplicates Query Wizard" which may be helpful. to use that, click the Create tab, and select "Query Wizard". You'll see the Duplicates Query in that list. Select that, and follow the prompts.
0
 

Author Comment

by:lux sat
ID: 40491453
Dale/Scott
I have attached the sample table as an image. I want to eliminate Row 3 ( 2 A B C).

ROW 1 is the fieldnames in my table.
TABLEIMAGE.JPG
Thanks,
LAKSHMI
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 40491564
Either of the methods I described above (using DISTINCT) or using a GROUP BY Clause will return a recordset that only has one result for A,B, C.  However, if you want to keep Field1 in the query, and that field is a unique value, it will force all rows to be returned with DISTINCT.  However, you might try:

SELECT MIN(Field1) as FirstOccurance, Field2, Field3, Field4
FROM yourTable
GROUP BY Field2, Field3, Field4
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question