Solved

ACCESS

Posted on 2014-12-09
5
194 Views
Last Modified: 2014-12-10
How to find Unique Records in ACCESS
0
Comment
Question by:lux sat
  • 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server views 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 Access…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

839 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