Deleting records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to delete records where ALL the Fields are equal. I have run a
delete query where it deletes eveything that is the same in one field but
unable to delete only the ones where all fields match.

Thank you for your help in advance.
 
Show us the SQL. Open the query in design view. Next go to View, SQL View
and copy and past it here. Information on primary keys and relationships
would be a nice touch too.
 
Jerry

What I tried to do was create 10 primary keys on 10 different fields and
then took the original table to make a new one. I thought this would require
all 10 to match and make a new table. Well it did not.

INSERT INTO [BL-PRO ADJUSTMENTS NO DUPS]
SELECT [BL-PRO ADJUSTMENTS ALL].*
FROM [BL-PRO ADJUSTMENTS ALL];

When I run a duplicate query on the 10 fields the result is about 82,000
records, meaning half a duplicated of 41,000. When I did the above etc it has
over 94,000 less records. Obviosly, it is finding duplicates in each primary
Key I identified and giving those. I need only the exact same records for all
fields to be taken out ONLY.

Hopefully this explains what I tried to do.
 
I am not a advance user--Sorry--I would need more details as to where to try
your suggestion below.

Thanks
--
Tom


Jerry Whittle said:
I'm a little confused. You can't create 10 primary keys in one table. You can
create one primary key with 10 fields or 10 unique indexes.

Try this:

SELECT distinct *
FROM [BL-PRO ADJUSTMENTS ALL];

How many records do you get now and how many do you expect?
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Tom said:
Jerry

What I tried to do was create 10 primary keys on 10 different fields and
then took the original table to make a new one. I thought this would require
all 10 to match and make a new table. Well it did not.

INSERT INTO [BL-PRO ADJUSTMENTS NO DUPS]
SELECT [BL-PRO ADJUSTMENTS ALL].*
FROM [BL-PRO ADJUSTMENTS ALL];

When I run a duplicate query on the 10 fields the result is about 82,000
records, meaning half a duplicated of 41,000. When I did the above etc it has
over 94,000 less records. Obviosly, it is finding duplicates in each primary
Key I identified and giving those. I need only the exact same records for all
fields to be taken out ONLY.

Hopefully this explains what I tried to do.
--
Tom


Jerry Whittle said:
Show us the SQL. Open the query in design view. Next go to View, SQL View
and copy and past it here. Information on primary keys and relationships
would be a nice touch too.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

:

I am trying to delete records where ALL the Fields are equal. I have run a
delete query where it deletes eveything that is the same in one field but
unable to delete only the ones where all fields match.

Thank you for your help in advance.
 
I'm a little confused. You can't create 10 primary keys in one table. You can
create one primary key with 10 fields or 10 unique indexes.

Try this:

SELECT distinct *
FROM [BL-PRO ADJUSTMENTS ALL];

How many records do you get now and how many do you expect?
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Tom said:
Jerry

What I tried to do was create 10 primary keys on 10 different fields and
then took the original table to make a new one. I thought this would require
all 10 to match and make a new table. Well it did not.

INSERT INTO [BL-PRO ADJUSTMENTS NO DUPS]
SELECT [BL-PRO ADJUSTMENTS ALL].*
FROM [BL-PRO ADJUSTMENTS ALL];

When I run a duplicate query on the 10 fields the result is about 82,000
records, meaning half a duplicated of 41,000. When I did the above etc it has
over 94,000 less records. Obviosly, it is finding duplicates in each primary
Key I identified and giving those. I need only the exact same records for all
fields to be taken out ONLY.

Hopefully this explains what I tried to do.
--
Tom


Jerry Whittle said:
Show us the SQL. Open the query in design view. Next go to View, SQL View
and copy and past it here. Information on primary keys and relationships
would be a nice touch too.
 

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

Back
Top