Delete Query Help

S

Sam

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

thanks.

sam.
 
G

Gary Walter

PMFBI

(replace yurtable w/ name of your table)

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

Sam

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