finding records with 3 or more same values(numbers)

S

sam

I have a table with the field name phone numbers
it looks like this
phone num
0408212630
0205101833
0609113234
1415162531
0308212630
above you can see that record no 1 and record 5 have 4
same numbers(08 21 26 30)
the output required is
0408212630
0308212630

there are thousands of records and there are many records
with the same numbers. Some have first 4 nos same, last
nos same, middle nos same, first and last 3 nos same etc.
What I would like to know is that how can I get these
records with the same 3 or more numbers reappearing in
other records in the table and there is only one field in
the table. And I am compairing one record with the other.
I would really appreciate for your help.
thank you.

..
 
S

sam

Thank you for your reply sir,
That code doesn't work.
I have created a query by adding the table twice with no
join link and on table_1.[phone number]'s criteria <>
.[phone number]
then I have put in to a vacant field cell the follwing
code:
Maches: Abs((Mid([1511].[data],1,2)=Mid([1511_1].
[data],1,2))+(Mid([1511].[data],3,2)=Mid([1511_1].
[data],3,2))+(Mid([1511].[data],5,2)=Mid([1511_1].
[data],5,2))+(Mid([1511].[data],7,2)=Mid([1511_1].
[data],7,2))+(Mid([1511].[data],9,2)=Mid([1511_1].
[data],9,2)))
and use criteria >=4
I have 200 records in the table, one field.
and when I run the query I get the following result
1511.data 1511_1.data Maches
04 08 16 20 29 04 08 21 26 30 4
02 05 08 15 22 02 05 10 18 33 4
02 05 10 24 34 02 05 10 18 33 4
02 05 10 26 34 02 05 10 18 33 4
02 05 09 14 34 02 05 10 18 33 4
02 05 10 12 23 02 05 10 18 33 5
04 05 10 17 33 02 05 10 18 33 4
02 05 09 14 32 02 05 10 18 33 4
02 04 10 18 26 02 05 10 18 33 4
02 09 10 16 26 02 05 10 18 33 4
11 15 16 21 25 14 15 16 25 31 4
08 12 22 28 30 07 12 22 23 24 4
07 12 19 29 30 07 12 22 23 24 4
07 12 25 27 30 07 12 22 23 24 4
08 12 22 27 28 07 12 22 23 24 4
07 12 20 28 29 07 12 22 23 24 4
07 12 23 26 27 07 12 22 23 24 4
03 19 23 27 28 03 19 27 28 29 4
03 19 22 24 25 03 19 27 28 29 4
03 08 15 18 34 03 08 17 18 20 4
03 08 09 17 20 03 08 17 18 20 4
07 12 19 29 30 11 12 19 24 25 4
11 12 25 29 30 11 12 19 24 25 4
11 12 24 25 27 11 12 19 24 25 4
05 12 19 25 34 11 12 19 24 25 4
06 11 16 22 34 06 11 16 32 34 4
02 10 21 24 32 07 10 21 26 33 4
02 14 17 21 31 02 14 17 25 30 5
02 14 21 26 31 02 14 17 25 30 4
10 14 17 26 34 02 14 17 25 30 4
02 14 17 19 24 02 14 17 25 30 4
02 14 17 24 26 02 14 17 25 30 5
02 12 17 28 29 02 14 17 25 30 4
04 10 14 19 30 04 10 12 19 26 4
04 10 12 26 27 04 10 12 19 26 4
06 16 22 26 28 06 15 22 27 29 4
06 15 20 22 29 06 15 22 27 29 4
06 15 22 24 30 06 15 22 27 29 5
06 15 22 23 28 06 15 22 27 29 5
04 15 22 23 28 06 15 22 27 29 4

I didn't paste all the results, As you can see sir, it
gives me result in 1511.data ---
02 05 10 24 34
02 05 10 26 34 ( in the beginning of the result)

06 15 22 23 28
04 15 22 23 28 (at the end of the results I have pasted)

what I want is when I run the query it should only give
me these four results or more with same 4 nos repeating.
AS you can see the result I pasted shows more records
with 2,3 and 4 nos same in the records, I need only 4 nos
same in the records as the output of the query.
And I don't want to eliminate these 4 nos result.
I would really appreciate if you can help me sir with
this problem.
thank you once again
sam
 
J

John Vinson

I have 200 records in the table, one field.
and when I run the query I get the following result
1511.data 1511_1.data Maches
04 08 16 20 29 04 08 21 26 30 4
02 05 08 15 22 02 05 10 18 33 4
02 05 10 24 34 02 05 10 18 33 4

I think that I was assuming (based on your previous message) that the
data field had ten consecutive digits, without blanks. If the field
actually contains the blanks you'll need to modify the Mid() function
to extract just the numbers. What's probably happening is that it's
comparing " 0" against " 0".

What is the ACTUAL FIELD CONTENTS of the fields that should be
compared? Remember, you can see your table; you know what it contains.
I DON'T, and I cannot read your mind or correct errors in your
postings!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top