Help with Code

aervin5

Registered User.
Local time
Today, 07:56
Joined
Nov 14, 2006
Messages
11
Hi everyone,

I'm wondering how to enter code that says, "Delete all the rows in a table except the last one". Does anyone know how to do this? I was thinking something along the lines of:

Do Until CurrentRecord Is Last
...
Loop

-with the "..." representing a simple deletion macro I built. However, this does not work.

Thanks!
 
the sql should look something like

delete * from mytable where mytable.tableindex <> indexoflastrecord

if you know what record you want to kepp, this is the easiest way.
 

Users who are viewing this thread

Back
Top Bottom