How to delete first n records from table in ms access

  • Thread starter Thread starter koliph
  • Start date Start date
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.
 
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]
 
Back
Top