Find Duplicates, Sum And Recombine!?!?!

Jan 29, 2007

Hi everyone,
I have a query as below:

Row1 Row2 Row3 Row 4 Row 5
1, 2, 2 , 0 , 15
1 , 2 , 2 , 1 , 7
0 , 1 , 1 , 4 , 2
1 , 2 , 2 , 0 , 29


I need to pull our records which have the same entries in Rows 1-4 and then add up Row 5. For example The above query would make three more queries i.e
One
1,2,2,0, 44

Two
1,2,2,1, 7

Three
0,1,1,4, 2

I would then wish to recombine them into one table
Final
1,2,2,0, 44
1,2,2,1 , 7
0,1,1,4, 2.

Is this possible and how would I go about doing this!?
Been scratching my head for awhile now!
thanks eveyrone!
Sue

View Replies


ADVERTISEMENT

Find Duplicates And Create Table With Dates Of Duplicates

Feb 12, 2008

Hi this is my first post... so hi all :)

ok what i have is a table with contact details 900k plus

there are about 90k of which are duplicates.

this is the basic feilds that are important in this case.

Id, data_source, data_recived, data_code,

what i want is to have a table with unique records (no dups in data_code)

this table will look like this...

Id, data_code, Num_dups, dup1_source, dup1_date, daysbtw_Dup1_dup2, dup2_source, dup2_date, daysbtw_Dup2_dup3 ,dup3_source, dup3_date, daysbtw_Dup3_dup4 ,dup4_source, dup4_date,

I know there is no more than 4 dups of each record.

what i want from this is a table that will give me a record of how many dups for each record then all the dates that they were added and the date between each record entry.

if anyone can help it would be great .

thanks in advance.

View 6 Replies View Related

Find Duplicates Different Than Duplicates Deleted

Dec 8, 2005

Hey, all! Thanks for helping, here is my situation.

I have a table with about 70,000 records that have duplicate Address field values. The rest of the field values for those records are different. When I do a find duplicate querry I get the result that 17,000 records have the same address. However, when I do the append qurrey as instructed here: http://support.microsoft.com/?kbid=209183 I get a total of only 600 records in the new table. I have tried deleting all of the indexes for both the new and old table, with no luck.

I'm using Access 2000 on XP Pro.

If anyone could help with this I would greatly appreciate it!

Thanks

Will

View 14 Replies View Related

Find Duplicates

Mar 4, 2008

Hi!
I used the find duplicates from the query wizard and it is not finding all of the duplicates. How can I fix this?

I have only a few fields
Last name, First name, address, parent name, email.

But when I ran the query the first time it found some.

Then I went into the table and I saw several that it did not find.

I don't get it.

View 5 Replies View Related

Find Duplicates - Sort Of

Nov 9, 2006

say i have a table called tblEmployees and i want to find people who have the same name but different employee numbers, can that be done with a query or will that require VBA code? i won't know the names ahead of time, i don't know who has the same name.

for example, columns:
first_name, last_name, employee_num, phone_num, office_num

and i want it to return James Smith with employee_num = 1234 and James Smith with employee_num = 9876.

View 5 Replies View Related

How Do I Run A Query To Find Duplicates??

Jun 6, 2007

hi all, im trying to make a query so that when someone updates a field in a form it searches a table (Companytable) which is a list of company names. If it exists i want it to then display a msgbox " already exists" sort of thing! trying to do this in the criteria field on the query. anyone have any ideas or useful resources, ive not done this for a while and cant remember much of IF THEN sort of stuff. mainly not sure if im barking up the right tree, i can search dependent on a set value but not sure how to do it dependant on whats been typed into a form..any pointers would be appreciated! thanks! James

View 2 Replies View Related

Query To Find Duplicates

Jun 15, 2007

Hi,

Our Contacts database has around 4000 individual contacts (and growing), which have been pulled together from four or five seperately maintained databases. As such there are bound to be duplicate records.

What would be a good way of querying the database to find duplicate entries (i.e. entries where the first name and surname are the same)? Short of putting everything in alphabetical order and manually scanning them to see if there are two names the same next to each other I don't know of a way to do it. Also, the manually-scanning method won't work if the names are spelled a little differently (Davies and Davis).

Any ideas?

View 1 Replies View Related

Find Duplicates Query

Jan 4, 2008

I know I have duplicate records in a table and therefore I used the "Find duplicates Query Wizard" to identify the duplicates.

I am positive - there are duplicates and the query does not perform the way it should be.

Any suggestion will be appreciated.

TKS
JLA

View 9 Replies View Related

Error In Code To Find Duplicates

Sep 29, 2005

Greetings all,

I have the code below which is giving me grief as I have copied it from a previous usage and it worked fine. I have tried it in a beforeupdate and now as a seperate button on the form and it gives me the same error message; I have tried to put a save command in to save the record without any luck

the code is

If DCount("[Batch]", "tbl_Data_Wine_Batch", "[Batch]=" & Me.Batch) > 0 Then
Cancel = True
End If


The error message is
Run time error 2001
you cancelled the previous operation.

The problem comes up in the dcount expression.

Any help would be great as it is an important part of the project and we can move on once we have overcome this

rbinder

View 1 Replies View Related

Find Duplicates That Don't Match Single Field

Jun 5, 2007

Hello all,

I am sure this must be simple, but I can't get my head around it.

I have a query that looks at client bank account numbers, and finds duplicates.

There are a LOT of duplicates, because we have several accounts for the same person.

What I would like to do is find all the records where the account number and sort code match, but where the account NAME is different.

I am trying to find any records where the same account number is being used on more than one account.

All the fields are in a single table.

This is what I have so far, which just finds duplicate sort codes and account numbers;
SELECT CPL_ACCOUNT.ACCOUNT_NUMBER, CPL_ACCOUNT.SORT_CODE, CPL_ACCOUNT.BANK_NAME
FROM CPL_ACCOUNT
WHERE (((CPL_ACCOUNT.ACCOUNT_NUMBER) In (SELECT [ACCOUNT_NUMBER] FROM [CPL_ACCOUNT] As Tmp GROUP BY [ACCOUNT_NUMBER],[SORT_CODE] HAVING Count(*)>1 And [SORT_CODE] = [CPL_ACCOUNT].[SORT_CODE])))
ORDER BY CPL_ACCOUNT.ACCOUNT_NUMBER, CPL_ACCOUNT.SORT_CODE;


Thank you!

View 1 Replies View Related

General :: Preventing Duplicates - Can't Find A Table

Aug 15, 2013

Access 2007 - I am using the oft used, frequently posted and shard code from srfreemen - modified as below. now I know I sort of broke commandment # 8 - Thou shalt not copy and paste other people's code without at least attempting to understand what it does. but I honestly did try to understand what it does.

I keep getting runtime error 3078 - cannot find the input table or query 'tblEnrolment_Committee_Master'. It is the name of a table in my database but I am missing the very basic element of how to get my form (which draws all of it's fields from that table) to look it up or identify it.

Likely because of a silly basic error. Normally - I wouldn't attempt such things but my work needs me to ensure no duplicates exist in this case AND it's already a primary key - but I don't want to wait until the whole form is filled out for it to identify the duplicate!

How to get the tblEnrolment_Committee_Master to be included in the search and erase this error ...

Private Sub Entitlement_File_Number_BeforeUpdate(Cancel As Integer)
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone

[Code] .....

View 3 Replies View Related

Modules & VBA :: Find Duplicates Of Values In Array

Oct 4, 2014

I have to deal with string arrays that store text. I need info on copying, comparing, appending arrays. Also on passing arrays as parameters to subs or functions. Where I can get to this info quickly without having to browse through many screens.

In addition to this I have some questions:

I have to find the duplicates of values in an array. Here is the code that I use.

Code:
Sub FindDuplicates()
Dim I As Integer, J As Integer, IEND As Integer, text() As String
ReDim text(IEND)
For I = 1 To IEND - 1
For J = I + 1 To IEND
If text(I) = text(J) Then text(J) = ""
Next J
Next I
End Sub

It works but is not performing well. Are there more efficient ways of doing this?

View 14 Replies View Related

Queries :: Amend SQL For Find Duplicates Query

Oct 23, 2014

I have a find duplicates query with the following SQL:

Code:
SELECT tblData.Vendor, tblData.[Loccurramount EUE], tblData.Last4, tblData.ID, tblData.Line, tblData.CoCd, tblData.[Document record number], tblData.PurchDoc, tblData.Reference, tblData.Curr, tblData.[Entry dte], tblData.Status, tblData.Version, tblData.Outcome
FROM tblData
WHERE (((tblData.Vendor) In (SELECT [Vendor] FROM [tblData] As Tmp GROUP BY [Vendor],[Loccurramount EUE],[Last4] HAVING Count(*)>1 And [Loccurramount EUE] = [tblData].[Loccurramount EUE] And [Last4] = [tblData].[Last4])))
ORDER BY tblData.Vendor, tblData.[Loccurramount EUE], tblData.Last4;

This works fine however I want to add another clause to the WHERE and I'm not sure how. At the moment the query highlights duplicates where the Vendor, Loccurramount EUE and Last4 match. I want to further restrict it so that it only finds duplicates where the Vendor, Loccurramount EUE and Last4 match BUT the number shown in version Does Not Match

So if two records have the same details for Vendor, Loccurramount EUE and Last4 and also have the same Version number then they don't show in the result.

View 3 Replies View Related

Writing Query To Find Duplicates Across Tables?

Apr 24, 2013

Employees submit information into a form which translates the information into a table. The table has been in use for years. By accident some employees were writing to an archived table while others were writing the the active table. This resulted in a field called "WorkID" being duplicated across the two tables.

Bottom line I am trying to write a query finding duplicates across tables but basing the duplicate only on certain columns.

View 5 Replies View Related

Find Duplicates Query Problems In Access 2007

May 1, 2008

I get a very strange error when trying to create a find duplicates query. When i try to select a table that has duplicate values it brings up a message box and it says that i must pick a table that has at least one field that's not a memo or OLE data type. I look at my table and I have niether of those in it...pretty much just text and number fields. Does anyone know what's going on?

View 3 Replies View Related

Queries :: Wizard To Create A Find Duplicates Query

May 29, 2014

I used the wizard to create a find duplicates query. I know for a fact that 15 records are duplicates. I'm getting over 300 records. When I dumped the data into Excel and did a pivot table to count the number of records by account number only 15 had a total count of 2. All others only had 1. Why are the ones with no duplicates showing? I just want to see the 15.

View 2 Replies View Related

Queries :: Find Duplicates - Resultant Datasheet Won't Close

Apr 24, 2013

I have a Find Duplicates query that I created with the Query Wizard.

IF I run the query and find duplicates, I can close the resultant datasheet with the close button.

IF I run the query and find duplicates and delete them, I can close the resultant datasheet with the close button.

IF I run the query after I have found and deleted duplicates and closed the window, I can close the resultant datasheet (with no records) with the close button.

BUT IF I run the query when there are no duplicates, it opens the datasheet with no records, but you can't close it with the close button. You have to exit the database completely.

I don't know SQL or VB. Have to do this in Access.

I thought about creating an If statement in a macro, but am not sure of the syntax, but this would be the basic statement I would make:

IF Find Duplicates query returns no records,
THEN Cancel Event.
End IF

View 2 Replies View Related

Queries :: Find Duplicates From 2 Tables And Remove From 1 Table

Jun 29, 2014

I have a report with 2 access tables (1 Master table and another a daily feed table)

The Master table keeps a log of all incoming records. (once append it to this table, should not show in future reporting)

The Daily feed information within the last 48 hours. (uploaded from an excel report into access temporary table)

When the daily feed table gets completed, I append the records and updated them into the Master to avoid duplication.

When I upload the daily feed table and I match it against the Master table to find duplicates, how can I delete the duplicates from the Daily Feed table?

This is my code to find duplicates:

SELECT CMPreport.ID, CMPreport.MbrName, tblMaster.ID
FROM CMPreport LEFT JOIN tblMaster ON CMPreport.ID = tblMaster.ID
WHERE (((tblMaster.ID) Is Not Null));

View 9 Replies View Related

Changing From Duplicates OK To No Duplicates

Nov 1, 2014

I have an Access table with an indexed key that is currently set to duplicates OK. There are not supposed to be any duplicates in that field. But it is possible than a small number have crept through.

Two questions:

1. What would happen to those duplicate records if I changed the setting from duplicates OK to no duplicates?

2. Is there any way to ferret out those duplicate records first and change them manually? The table currently has 48000 records so it would be a pain to go through them page by page. (I know how to export them to Excel, where the dups can easily be found; I was just wondering if something could do it within Access.)

View 2 Replies View Related

Queries :: Find A Way For Access To Find Unique Dates And Unique Names?

Aug 1, 2014

I have been working on a simple data base for some time now (beginner level) and am still trying to improve it. I would like to do something but before that I would like to have your opinion to know if it is even possible?I have a query QryMainReport:

Start Date/Time
End Date/Time
Employee

At the moment this is what the format of my report looks like (I removed other unnecessary fields):

StartTime----------EndTime---------------Employee
12/06/2014 01:00--12/06/2014 03:00------John Smith
12/06/2014 04:00--12/06/2014 06:00------Jane Doe
13/06/2014 02:00--13/06/2014 05:00------John Smith
13/06/2014 08:00--13/06/2014 08:00------Jane Doe

I would like to do as a report. (Dates would always be from Sunday to Saturday). I am not sure it is possible to do that. I suppose first it would mean:I would have to do a query to separate the times from the dates?I would have to find a way for Access to find the unique dates and unique names?Does it mean I have to use cross tab queries?

View 2 Replies View Related

A Word Find Can't Find

May 23, 2005

A customer's name is SZEE. Seek him through the SName textbox with Find, and Access can't find him. (Same in the table.) Seek him with a wildcard Sz* and there he is.

I've tried it on another machine - also with Access2k - and it's the same.

Is it an Access quirk? Is there an answer? (The client asks why. Be good to be able to say.) Cheers.

View 3 Replies View Related

Odd Duplicates

Jul 5, 2007

Hi. I have two tables, of which i have run a duplicate query, removed the duplicates by doing an "is null" criteria, and keeping that new table.
I know though there are still more duplicates but the names may not be exactly the same, say barclays and barclays plc. so i run another query on both tables to show me the first five letters of table 1 and table 2. I can run another "is null" criteria query to find the non duplicates there. these are the unique values.

But even if there are duplicates up to the first five letters the next letter may change, for instance barcleys tractors and barclays bank. So these arent duplicates.
So can anyone come up with a way of taking the duplicate ones according to the first five letters, and maybe duplicate ones up to 10 letters, and working out which ones are the unique ones. my brain is frying.

thanks
alex

View 7 Replies View Related

Duplicates

Jul 14, 2005

Hi

I have imported a 1 column table from an external source for the sole purpose of deleting duplicates. There are over 400,000 rows. What do i need to do to identify the duplicates?

Thanks

View 2 Replies View Related

Please Help With Duplicates

Apr 11, 2007

I work at a hospital and deal with several thousand account numbers a day. I am working on an Access database that will handle some of my workload. Here is what I am facing. Lets say on some of the tables that I import there are duplicate account numbers with different totals in the end...

acct info info info amount
123456 xxxxx xxxxx xxxx 5.50
123456 xxxxx xxxxx xxxx 17.50
123456 xxxxx xxxxx xxxx 900.00
753951 xxxxx xxxxx xxxx xxxxxxxx

and so on...

is there a way that i can only show one account number but the total of the amount for the account? please help...this is desperately needed.

JG

View 6 Replies View Related

Several Pk's And Duplicates Ok?? WHAT??

Oct 9, 2007

Hey All, i'm looking for some help from one of the heavy hitters in the Access Forum. (Keep in mind i'm self-taught in access..never picked up a book on the stuff) So far i have done ok. I'v made many databases and in my opinion i have a firm grasp on the fundamentals.

I have come accross a database that I did not create which i am suppose to work on. I can do the work just find but i'm a little confused on the structure. when i looked at the relationships i noticed that many of the field names in several tables were bold (showing they were set as a primary key) So i looked at the design view of a few of these tables and noted that the primary key was set on 3 different fields. i also noticed that each field allowed duplication. Furthermore i noticed that on at least one of the tables, in the relationship window there was a relationship using the ID field which was a 1 to many. however there was a relationship on the other side of that table still using the ID field that was a many to one. How can a field have a one to many relationship and a many to one?? it can either be duplicated or it can't...right???
Anyways i also tried to duplicate this in a test database and found that when you make a table and then right click at the side of the field you wish to make as Primary key, that works fine, but doing it on another field simply switches the primary key to that field and takes it off the first one.

(as a side bar..is the only way to search this forum to go manually through all the threads to see if you can find what you need? aka...no search tools?? or did i just miss them?):confused:

View 9 Replies View Related

Duplicates

Aug 11, 2006

I have a table that has country_code, Mfr_num, Item_num, catalog_code, mfr_obsolete_code. the key is on country_code, mfr_num, and item_num. I need to find duplicates of mfr_num and catalog_code. Can anyone point me in the right direction on this?

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved