Removing Duplicates From A Table

Aug 19, 2004

Hi,

I'm running MS Access (2002 SP-2)

I have a table that has the following columns in it:

Sent NBR (text) / Sent Date (date/time) / PIC (text)

It's a customer listing of our customers and which long distance carrier they have selected. Unfortunately my data also shows OLD customers that no longer own that phone number. Because of this, various phone numbers are listed numerous times, but only the Sent NBR with the most current Sent Date is the one I need to see. The others are irrelevant and need to be deleted. I'd manually delete the duplicated Rows but I have over 115,000 duplicates!!


Do you guy know of a way to eliminated the duplicates for each Sent NBR and only show me the Sent NBR's with the Most current date?

Any help would be greatly appreciated!

Scott

View Replies


ADVERTISEMENT

Removing Duplicates From A Query

Aug 14, 2006

I am running a query to return records from a table. I want to eliminate records from the query if the values contained in one field are duplicated. I have tried using the DISTINCT keyword but it only works if the entire record is unique or if I was retieving just one field

Any suggestions appreciated

View 1 Replies View Related

Removing Duplicates From Dataset

Dec 12, 2011

I have data that I want to combine. However the separate data sets have some duplicates.

Let's say it is Customer Num field.

What I am saying is I am trying to combine the data sets to make a table with Customer Num and Customer Name.

I want to eliminate the duplicates. What is the best way to do this? Is there a feature in Access for this?

View 5 Replies View Related

Merging And Removing Duplicates

Aug 9, 2013

I have a table with few Employee ID re-appearing over and over again for two different job status.

Data Example

EMP ID Job Code Emp Name Country Job Status Time Spent (In Hrs)
222 9250 XYZ ABC Complete 6
222 1059 XYZ ABC InComplete 12
222 5050 XYZ ABC Complete 7
222 1050 XYZ ABC InComplete 9
111 2750 MNM IJK Complete 2
111 2150 MNM IJK InComplete 3
111 6550 MNM IJK Complete 7
111 8250 MNM IJK InComplete 9

I need an output which merges the data based on Emp ID, however, adds the time spent for completed and incompleted job status in 2 rows.

Output Requirement:

EMP ID Emp Name Country Job Status Time Spent (In Hrs)
222 XYZ ABC Complete 13
222 XYZ ABC InComplete 21
111 MNM IJK Complete 9
111 MNM IJK InComplete 12

Which query to use? I use Access 2010.

View 1 Replies View Related

Removing Duplicates While Keeping A Running Total

May 10, 2005

High everyone I've had a look around the FAQ's and other threads but haven't been able to find what I'm looking for.

I have a table that contains two fields, one being 'part number' and the other being 'quantity'. Unfortunately there are multiple duplicate 'part numbers'. I am looking at keeping only one instance of the duplicate 'part numbers' but at the same time I want to add the 'quantities' together to keep a running total.

For example:

Before
Part Number Quantity
a1 1
a2 2
a3 2
a1 1
a2 1
a1 4
a1 1

After
Part Number Quantity
a1 7
a2 3
a3 2

Any help would be greatly appreciated.
Cheers

View 5 Replies View Related

Access 97 - Query Help - Newbie - Removing Duplicates

Jan 25, 2007

Hi,

just finding my way in Access 97 with no real support. I have made a query that creates duplicate records when I only need to see one for a certain criteria (lets say criteria X). This is due to the data feed involved in making the query where criteria X is found in numerous records.

What I want to display is only one record per entry containing an exact match for criteria X.

Finding it hard to articulate this but I would need something that defines:

If criteria X is the same, just display one record.

Hope this is somehow clear as I am struggling a bit. Would be gratefull of some help.

Thanks

View 3 Replies View Related

Forms :: Removing Duplicates From Drop Down List

Jun 17, 2013

I have created a database which is used as a sign in and out machine for students. I have 2 forms a 'sign in' which has a lookup list containing all student names. as well as date and time and a 'sign out form' which uses a lookup list from the sign in form.

It collects data fine but when a student signs in and out a second time there name is duplicated in the 'sign out' drop down list. The student must select the right name out of the duplicates otherwise it wont record.

Im just wondering if there is some sort of fix to this.

View 1 Replies View Related

Removing Duplicates But Keeping Lastest Record

Dec 23, 2014

i have queries and tables with several duplicated "username" records. What should i do to remove the record with a smaller value of "win/loss" and keep the duplicated "username" with a bigger value of "win/loss".

View 1 Replies View Related

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

Removing Table Links

Mar 2, 2007

This may seem like a silly question, but I can’t find the answer to it on this forum. People only say 'Remove the table links' but never how. I can’t seem to be able to remove the table links completely, so I only have one database file (no backend or frontend). I can’t seem to do it though the Table link manager or any other way. Any help?

Thanks in advance

View 4 Replies View Related

Removing All Captions From Table - Macro?

Apr 12, 2005

Hi.
I regularly import tables with many fields from a third party application into Access 2000.
These fields all have captions as well as field names (obviously!) but I give them much more meaningful "friendly" names. But to do this I must first manually delete all the captions.
Is there an easier way?
Thanks in advance.

View 1 Replies View Related

Removing A Subset From A Main Table

Aug 2, 2007

I have 3 parcel tables. Table 1 contains the parcels of the whole county. Table 2 contains open space parcels and table 3 contains preserved farmlands. I would like to remove parcels in tables 2 and 3 from table 1. Tables 2 and 3 are subsets of table 1.

Basically I have these:

Table 1
PIN attribute1 attribute2 .....attribute6
1
2
3
.
.
.
52,000

Table 2
PIN
5
8
9
12
18
335
789
.
.
.
N

Table 3
PIN
41
51
66
3
78
903
1245
.
.
N

Note that tables 2 and 3 only contain PINs
Does anyone have a script for this problem?
I would appreciate your help on this. Thank you.


Jun

View 7 Replies View Related

Tables :: Removing Duplicate Records From One Table

Feb 18, 2014

I have a table with at least 13.000.000 records. There are many duplicates records... For example

ID Name Family mobile car number chassis Register_Year
1 Roy Jalbout 9999 123456/G ASF4546 2005
2 Roy Jalbout 9999 854658/G GRK554JFJD 2009
3 Tony Elishah 1234 854658/G GRK554JFJD 2012
4 Sam Markos 5478 854658/G GRK554JFJD 2014
5 Roy Jalbout 9999 123456/G ASF4546 2005

As you can see ID Number 2,3,4 have the same car but every one bought from another so it's not duplicates

The duplicates here is the ID's number 1,5. So how to remove the duplicates. I remember you i have at least 13.000.000 records. I try to make a query to find duplicates then i make a copy of the original table and than i should make a primary key then append the data from the original table to the copy table, but here i have more than one criteria

When I made a query to find duplicates the result was 680.000 records and every one have a minimum 2 duplicates an maximum 4 duplicates so it's about 2.500.000 duplicates records at least....

View 5 Replies View Related

Removing Parentheses And Its Contents From Access Table Field

Jun 18, 2014

I am very new to access less than 1 week since i started trying to build an horse racing database, i am trying to link data from 2 different sources via the horses name however one source displays this with the horses country of origin in parenthesis foe example FRANKEL(GB) and the other source displays the name as just FRANKEL, to be honest i haven't yet tried the link but guess it will fail.

I am therefore looking to get rid of the parentheses and their contents from an access table field and create another field without them.

In Excel i use the formula B1:

=TRIM(REPLACE(A1,FIND("(",A1&"("),FIND(")",A1&")")-(FIND("(",A1&"(")-1),"")) and that works fine.

I guessed the solution for Access would be newname:

TRIM(REPLACE([frhorse.NAME],FIND("(",[frhorse.NAME]&"("),FIND(")",[frhorse.NAME]&")")-(FIND("(",[frhorse.NAME]&"(")-1),""))

But this doesn't work as in returns undefined function "FIND" in expression error.

View 7 Replies View Related

Queries :: Removing Grand Totals From Query Pivot Table

Jun 17, 2013

To keep it short and sweet, my query set up is: Employee, Team Name, and then I have the same field in the column as I do in the data and it presents pass/fail data. I have the data shown as a percent of the row so that there is a success rate shown but I want to remove the grand totals from the rows because it is obviously going to be 100% every time and it's unnecessary.

View 13 Replies View Related

Queries :: SELECT DISTINCT Not Removing Duplicate Records In Staging Table

Jan 29, 2015

I have a database with an import process which normalises incoming data and appends to various tables. No issues with that. I also have a function within that process which counts the number of new entries for a summary popup when the process has completed.This works by querying the staging table, prior to the append, into a recordset and using the .RecordCount to increment the count (multiple files can be imported at once so this effectively provides a running count, per file, to give a total for the whole import)

I thought it was working fine but this morning I noticed that the count which appeared on the popup was 1 greater than the number of actual new records. I checked the source files and noticed that, for whatever reason, there was a duplicate entry in there. So I presume that's why the count was out by 1.

There's no integrity issue in the main tables as the composite primary keys ensure that duplication shouldn't be a problem. Indeed, the record in question, duplicated in the source, appears only once in the main table post-import. So not too worried about that.

However, I need the count in the popup to be accurate (it tells the users how many new entries require further investugation). And what's puzzling me is that I use DISTINCT in the query, which I would have thought should eliminate any potential dupes in the recordset and thus provide the correct count. It seems it doesn't?

Code:
Public lngNewBalancesTBI As Long ' Defined in a separate module...
-------
Dim dbs As Database
Dim rst As Recordset
Dim strSQL As String

[code]....

Why the dupe, which is still present in the staging table, also makes it over to the recordset, even though I'm using DISTINCT?

View 14 Replies View Related

Updating Data In Table B Based Off Table A - Duplicates

May 19, 2013

I have two tables, Table Products & Table Sold and I'm trying to aggregate the products table to reduce the total number of products and I want this update to happen with all tables that share a 1 to many relationship with the product table. (table sold is one of those).I have products apple, pear, bananna. I am now aggregating them to all just be called fruit. Problem is when I make this change in the product table I get this error:

"The changes you requested to the table were no successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again."how to go about aggregating data in a table that has 1 to many relationships with many other tables. A

View 2 Replies View Related

Table...No Duplicates

Dec 10, 2007

Why would the Idexed change from "Yes (No Duplicates)" to "No" while data is being entered in a form?

View 1 Replies View Related

Duplicates In Table/Query

Aug 1, 2007

I am using a combo box to assign gun numbers on an employee form (frmemployees). I also have a query listing only the gun numbers that have been assigned. When I select a gun from my combo box, I what to evaluate if it is already on the gun assignment query. That way I cannot assign the same gun to two different people. I am using the before_update event to do this. The code that I am using is as follows:

Private Sub intgunNumber_BeforeUpdate(Cancel As Integer)

If DLookup([intgunNumber], "qrygunassignmentcurrent", Me.intgunNumber) = Me.intgunNumber Then
MsgBox "Item # is already listed.", vbOK, "DUPLICATE FOUND"
Cancel = True
End If

"me" represents my frmemployees form. The problem is that it's causing an event even for the numbers that aren't listed on the query. I am trying to get the evaluation correct but am having difficulties. All the fields are numeric fields. :( :mad:

View 6 Replies View Related

Make Table For Duplicates Only

Jan 11, 2005

How do I make a table from another that will only display the duplicate records in a field .... I have add'l fields in addition to the partno but not relevant.

i.e. partno new table will show:
0001 0001
0002 0001
0001 0003
0003 0003
0003

Thanks for your help....

View 2 Replies View Related

Duplicates In A Table-Help Needed

May 19, 2005

Hi Everyone, I need help in selection of primary key and designing of a tables. I am having a table called Current trailers with Trailer number as a primary key. I have similar table to current trailers called history table in which the trailers that left the yard are stored. As a trailer can enter and exit the yard couple of times in a week, its not letting me to have duplicates in the history table.So can anyone help in selection of primary key for the history table. Or can anyone tell me how I can have duplicates in a table.

Thanks in Advance,
Naveen

View 2 Replies View Related

Duplicates Records In Table

Mar 30, 2007

Hi

I want to amend my query so that all duplicate records don't appear. For example when the query is run the information generated includes:
Day the audit took place
Room the audit took place in
Faculty the activity belongs to
Staff lecturer(s) who takes the class
Activity that was going on when audit took place
Start time of Activity
Finish time of Activity
Counted number of people in the room

Therefore, if there is an activity going on for a faculty but there is more than 1 staff name against it, I just want 1 record to appear against that faculty. Whereas what is happening for example is that there is a activity which takes place from 3pm to 4pm and the activity belongs to the Faculty of Computing and Engineering, and as the class was taken by 3 different lecturers, 3 separate records appear. I am concerned about this because the information is then used in a summary report for each Faculty for the year, so in this case the summary report will calculate 3 activities when it was just 1 activity.

It would be great if its something I could just amend in the query, and not in the source table.

Much appreciated

View 1 Replies View Related

Combine Fields From One Table Without Duplicates

Jan 30, 2008

Hello,

In access 2003 i have an external Oracle table named EXT-COM_EXTRA_DATA_FIELDS
in this table I have the following fields: COM_DATA_KEY, COM_DATA_FIELD_NO, COM_DATA_VALUE

From this I have created a query named: LOOKUP-BARCODES-10 this looks at the above table by filtering the
the records on the field: COM_DATA_FIELD_NO where this =10.

Also I have created a second query named: LOOKUP-BARCODES-20 this looks at the above table by filtering the records on the
field: COM_DATA_FIELD_NO where this =20

Below is sample data in the table:

COM_DATA_KEY; COM_DATA_FIELD_NO; COM_DATA_VALUE
009A/s 10 03010303165001
009A/s 20 04350309115002
010B/P 10 05150909116001
010B/P 20 06150909116002
011C/X 10 07281809217003
011C/X 20 N/A


The problem is i would like to combine the numbers in the COM_DATA_VALUE field for the same product (ie the same COM_DATA_KEY
record) on the same rows without any duplicate records as shown below:

COM_DATA_KEY; COM_DATA_VALUE; COM_DATA_VALUE (2)
009A/s 03010303165001 04350309115002
010B/P 05150909116001 06150909116002
011C/X 07281809217003 N/A

As you can see from above some records only have data in one COM_DATA_VALUE (like 011C/x) where COM_DATA_FIELD_NO = 10 but no
data for the same product where the COM_DATA_VALUE = 20.

Im thinking maybe i can create a new join query that looks at the above two query’s and combines the values in the COM_DATA_VALUE for
the same product onto the same record row but im not sure how to go about this without creating duplicates & its been some time since ive done joined queries. Any help would be great?

ive attached a cut down version of the database with the table imported from oracle rather than being linked to oracle if this helps.

Thanks

Kevin

View 2 Replies View Related

Copy Data From One Table To Another & Check For Duplicates

Aug 8, 2005

hi, I have 2 Tables: tablea & tableb. The field names in both tables are: user_id, firstname, lastname, from these i have 2 querys (querya & queryb) both of which just look at the fields from the repective tables, & from this i have 1 form (entry form) that pics up the fields from querya. I would like to be able to enter details (records) into the entry form which puts all the data into tablea then automatically copies all the information into tableb, then automatically checks to make sure there are no duplicate records in tableb and finally deletes all the records out of tablea (probably after the form closes). This might sound a bit strange why i want to do this but I hope if its possible it could be used in a larger database.

I think i need to do querys but not sure what I need to do, Any advise would be very helpful.

View 3 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

Queries :: Remove Duplicates Entries In Table?

Jun 11, 2013

I have a table called Stock Levels which contains 3 fields. (ID, ProductID, StockLevel) ID is the Pkey, ProductID contains duplicates and StockLevel which contains different stock levels

and I am trying to remove the duplicates and retain the the data so I am left with the correct stock number

what I have done is the following, but I am still getting duplicate values in productid and stocklevels

SELECT DISTINCTROW id, productid, stocklevel into mynewtable from stocklevels

I have attached a screenshot of the table

View 3 Replies View Related







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