Delete Query - deleted next 100 records

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

Guest

Hello,

Can you tell me how to delete the next 200 records. These could be any
random records - just want to delete 200 records with a query.

Thanks.
Bonnie
 
Well, I haven't had occassion to try this, but how about using the TOP
operator? The sql would look like this, if it is supported ...

DELETE TOP 200 FROM tblOoops

or maybe in Access it needs to look like this ...

DELETE TOP 200 tblOoops.* FROM tblOoops
 
It is a rather strange requirement but a Delete Query with SQL String like:

DELETE *
FROM [YourTable]
WHERE [YourTable].IDField IN
(
SELECT TOP 200 Sub.IDField
FROM [YourTable] AS Sub
);

should do what you want.
 
Danny

I tried the TOP predicate in a Delete SQL and JET doesn't like it. Hence,
my suggestion of the SubQuery.
 

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