473,387 Members | 1,766 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,387 software developers and data experts.

Need query to find potential duplicate names

Hello,

I need help to modify a query in MS Access 2010 - I need to find duplicates in [FIELD NAME] where they start with the same 5 letters. I created a regular "find duplicates query" but then I cannot figure out how to modify to make it locate ALL the entries that START with the same 5 characters.

Expand|Select|Wrap|Line Numbers
  1. In (SELECT [Field Name] FROM [TABLE] As Tmp GROUP BY [Field Name] HAVING Count(*)>1 )
Dec 19 '12 #1

✓ answered by NeoPa

It looks like you just need a little bit more in your SQL LiveWire. try out :
Expand|Select|Wrap|Line Numbers
  1. SELECT   [Field Name]
  2. FROM     [Table]
  3. WHERE    Left([Field Name],5) In (
  4.     SELECT   Left([Field Name],5)
  5.     FROM     [Table]
  6.     GROUP BY Left([Field Name],5)
  7.     HAVING   Count(*)>1)

4 3152
NeoPa
32,556 Expert Mod 16PB
It looks like you just need a little bit more in your SQL LiveWire. try out :
Expand|Select|Wrap|Line Numbers
  1. SELECT   [Field Name]
  2. FROM     [Table]
  3. WHERE    Left([Field Name],5) In (
  4.     SELECT   Left([Field Name],5)
  5.     FROM     [Table]
  6.     GROUP BY Left([Field Name],5)
  7.     HAVING   Count(*)>1)
Dec 19 '12 #2
It worked like a charm. Thanks!
Dec 19 '12 #3
NeoPa
32,556 Expert Mod 16PB
I'm pleased it worked. The real question is whether or not it makes sense to you. If not then we should work on that ;-)
Dec 19 '12 #4
It totally does - I am relatively new to this kind of stuff so i could not figure out the syntax. Thanks for your help!
Dec 19 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Terry Olsen | last post by:
I want to query AD for computer names. I can do it with using the dsquery command "dsquery computer -name MTBIL* -limit 0" and parse the computer name out of the response, but I'd like to know...
1
by: alf | last post by:
Hi, I need to find all modules/lib from the site-packages along with the versions. Is there a way to determine physical path to the module? And is there is a way to identify all potential...
3
by: Don | last post by:
I am writing a program and need to identify the friendly names of ports. I have queried the registry key HKEY_LOCAL_MACHIN\\EHARDWARE\\DEVICEMAP\\SERIALCOMM, but all that tells me is which ones...
5
by: Chuck | last post by:
Looking for duplicat names is tough. How many Bob Smiths do you know? Searching for a Concatenation of: &&& with no spaces between fields works pretty good but is not fool proof. Are M.I....
1
by: sree078 | last post by:
hi I've a table with coln names ID Name ParentID Level
1
by: aknoch | last post by:
My basic situation is this - I ONLY want duplicates, so the opposite of DISTINCT: I have two tables. Ordinarily, Table1ColumnA corresponds in a one to one ratio with Table2ColumnB through a...
3
by: jerrys57 | last post by:
Hi All, Need some help with a listbox display to textbox...After loading my listbox from the database, I need to be able to select duplicate names and display them in a textbox....it works fine on...
12
by: trbjr | last post by:
Here is my scenario: Screen A ===> Screen B ===> Screen C \\ \\ V Screen C What this means is that sometimes Screen A opens B...
1
by: vetrib2w | last post by:
Hi friends, I need to find the record size when i m fetching the data from mysql table . example: id|name | details| 1 |vetri | b2w | 2| peter | dog | query: SELECT * FROM example where...
3
by: cbjones | last post by:
Before I ask my question, please know that I am quite new to writing SQL queries and I am struggling with a SELECT issue involving JOIN so if I sound a little naive, I am a true newbie. In...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.