473,394 Members | 1,811 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Find Duplicates

I have a form that uses has a series of about 10 different queries to
get the final VIEW query to populate my form. I wrote the below to find
the duplicates, which works. I don't want to delete the duplicates just
not show them. Any ideas? I just want to show the records that have NO
duplicates.

SELECT [UWID], [UWName], [JobTitle], [BUName], [EmployHireDate],
[ApptStartDate], [TermDate], [EmployTypeCode], [Active], [DL_Loans],
[DL_Loss], [DL_Watch], [DL_Refer], [LR_Loans], [LR_Penalty],
[LR_Correct], [LR_Watch], [LR_Refer], [AuditLevel], [CSAudits_2004],
[CS2004_Perc], [CSAudits_2005], [CS2005_Perc], [CSAudits_12MoCum],
[CS12Mo_Perc], [CS_SigFinds], [DLPriorLosses], [DLNewLosses]
FROM qry2005WatchListInfo
WHERE [UWID] In (SELECT [UWID] FROM [qry2005WatchListInfo] As Tmp GROUP
BY [UWID] HAVING Count(*)>1 )
ORDER BY [UWID];

Jun 7 '06 #1
6 3094
Change "Count(*)>1" to "Count(*)=1", which finds only the ones that don't
have duplicates.
Jun 7 '06 #2
What if I want all that have just one copy AND one record only of those
that have multiple copies?

Thanks!
Rick Wannall wrote:
Change "Count(*)>1" to "Count(*)=1", which finds only the ones that don't
have duplicates.


Jun 7 '06 #3
What field uniquely identifies each row in the table you're selecting from?
Jun 7 '06 #4
By it cannot identify each row uniquely, since it is the field you're using
to detect duplication.

If you want to be able to present just one row out of a group of duplicates,
you must have one (or some combination of fields) that would uniquely
identify the rows, so that it is possible to select the
min/max/first/last/something unique identifier from within the group
identified by the same UWID. Sometimes a date field works for this. If you
have a DateCreated field, or DateUpdated, that might do the trick.
Jun 7 '06 #5
UWID is the keyfield in the table

Rick Wannall wrote:
What field uniquely identifies each row in the table you're selecting from?


Jun 7 '06 #6
It could also be done with a subquery or multiple queries using the TOP 1
option, if it doesn't matter which of the records with duplicate key is
chosen.

Larry Linson
Microsoft Access MVP
"Rick Wannall" <wa*****@notadomain.de> wrote in message
news:wC********************@newssvr21.news.prodigy .com...
By it cannot identify each row uniquely, since it is the field you're
using
to detect duplication.

If you want to be able to present just one row out of a group of
duplicates,
you must have one (or some combination of fields) that would uniquely
identify the rows, so that it is possible to select the
min/max/first/last/something unique identifier from within the group
identified by the same UWID. Sometimes a date field works for this. If
you
have a DateCreated field, or DateUpdated, that might do the trick.

Jun 10 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tom Mitchell | last post by:
All: I'm stumped on a query. How do I find duplicates in a table where one of the duplicates has values is a certain field and the other doesn't. For example, I have the following table: ...
1
by: Phil | last post by:
Hi. There is probably a very simple explanation for this. I am using the find duplicates wizard, I am asked for the fields that may contain duplcate info. So far so good at this point it functions...
2
by: Phil | last post by:
Hi. I have a table containing primary address, secondary address, road,town, postcode, there are otherfields within the table requestid, round, day, etc. I want to find all instances of the...
7
by: figital | last post by:
Given an ID (column B), I need to find which IDs have identical data. That is, given '200', I want the desired result to be: 100 The idea is that the system sees that id=200 has 5 records with...
4
by: Killer42 | last post by:
Hi all. Sorry, this is probably a really simple one but I'm having some difficulty with it, and don't have much time to devote to it right now. I need to find all the records which have...
3
by: AccessHunter | last post by:
Please help with writing a VBA Code to find duplicates from the following acces table. Fields:- TranDate, Job Num, Agency Name Date is like this, 1/3/2003, 757702, People Office...
2
by: tuananh87vn | last post by:
Hi ! can anyone help me with the following topic: Find All Duplicates in a List of Numbers - Array implementation - -InitializeTree() -AddNode() -Add into...
5
by: limperger | last post by:
Hello everyone! Is out there any way to search for duplicate entries without using the "Find duplicates" option? In the Access 97 installed in my workplace, the Find duplicates option is disabled...
1
by: stateemk | last post by:
I have an Access project and need to find duplicates in table. How do I create a query to find the duplicates?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.