Delete Query Help

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

Guest

Can someone tell me how to delete all records in a table and keep only the
last one using a query?

thanks.

sam.
 
PMFBI

(replace yurtable w/ name of your table)

DELETE * FROM yurtable
WHERE [id] < DMax("id", "yurtable")
 
thanks Gary,

It works exactly as i wanted.

cheers.

Gary Walter said:
PMFBI

(replace yurtable w/ name of your table)

DELETE * FROM yurtable
WHERE [id] < DMax("id", "yurtable")

Sam said:
the last record keyed in, so having the last id (autonumber).
 

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