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).
 
Back
Top