How to delete first n records from table in ms access

K

koliph

Hi friends,


i am having a table with more than 5000 records, i want to delete first
1000 records. anybody know what is the query for this in ms access?


Thanking you.
 
J

John Vinson

Hi friends,


i am having a table with more than 5000 records, i want to delete first
1000 records. anybody know what is the query for this in ms access?


Thanking you.

Tables *have no order*. Talking about "the first 1000 records" is a
bit like talking about the first 1000 beans in a gunnysack of beans!

Is there some field in the table that specifies an order? If so, you
can use a TOP VALUES query:

DELETE * FROM tablename
WHERE IDField IN
(SELECT TOP 1000 X.IDField
FROM tablename AS X
ORDER BY somesuitablefield);

John W. Vinson[MVP]
 

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