G Guest Jun 15, 2006 #1 Can someone tell me how to delete all records in a table and keep only the last one using a query? thanks. sam.
Can someone tell me how to delete all records in a table and keep only the last one using a query? thanks. sam.
L Lynn Trapp Jun 15, 2006 #2 Sam, How do you define "the last one"? -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm Jeff Conrad's Access Junkie List: http://home.bendbroadband.com/conradsystems/accessjunkie.html
Sam, How do you define "the last one"? -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm Jeff Conrad's Access Junkie List: http://home.bendbroadband.com/conradsystems/accessjunkie.html
G Gary Walter Jun 16, 2006 #4 PMFBI (replace yurtable w/ name of your table) DELETE * FROM yurtable WHERE [id] < DMax("id", "yurtable")
PMFBI (replace yurtable w/ name of your table) DELETE * FROM yurtable WHERE [id] < DMax("id", "yurtable")
G Guest Jun 16, 2006 #5 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). Click to expand... Click to expand...
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). Click to expand... Click to expand...