I have been given a spreadsheet that I have imported into Access, and I want to delete quite a large number of rows. The records have a Customer ID field (Primary Key), addr1, addr2, ..... Duplicate.
If the Duplicate filed has a Y in it then there is an address with 2 Customer ID’s (an Old Tennant) however I only want the latest tenant.
So I have run a query that shows all Duplicate = “Y” , sorted by Address 1, then Customer ID...this has given me about 7000 records.
Is there anyway of easily deleting every Odd record i.e. records 1,3,5,7,.......6997, 6999?
SELECT *
FROM [tblCust]
WHERE ((([tblCust].[Duplicate])="y"))
ORDER BY [tblCust].addr1, [tblCust].CustID;
Sorry - I have just been sent an updated spreadsheet and some of the records have more that 2 customers at an address, so I need to delete all duplicates leaving the address and Customer ID, where the Customer ID is the largest number:-
CustID Addr1
2000134 10 BEECHES TERRACE
2005634 10 BEECHES TERRACE
2006023 10 BEECHES TERRACE
2006034 10 BEECHES TERRACE
In this example I would want to delete the first 3 and leave the record with CustID 2006034
If the Duplicate filed has a Y in it then there is an address with 2 Customer ID’s (an Old Tennant) however I only want the latest tenant.
So I have run a query that shows all Duplicate = “Y” , sorted by Address 1, then Customer ID...this has given me about 7000 records.
Is there anyway of easily deleting every Odd record i.e. records 1,3,5,7,.......6997, 6999?
SELECT *
FROM [tblCust]
WHERE ((([tblCust].[Duplicate])="y"))
ORDER BY [tblCust].addr1, [tblCust].CustID;
Sorry - I have just been sent an updated spreadsheet and some of the records have more that 2 customers at an address, so I need to delete all duplicates leaving the address and Customer ID, where the Customer ID is the largest number:-
CustID Addr1
2000134 10 BEECHES TERRACE
2005634 10 BEECHES TERRACE
2006023 10 BEECHES TERRACE
2006034 10 BEECHES TERRACE
In this example I would want to delete the first 3 and leave the record with CustID 2006034
Last edited: