Deleting Records

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

Guest

I have a table like this:-

ID RevNo Other Fields Generated
1 0 a 26/03/07 15:00:00
1 0 b 26/03/07 15:00:00
1 0 c 26/03/07 15:00:00
1 0 a 26/03/07 15:15:00
1 0 b 26/03/07 15:15:00
1 0 c 26/03/07 15:15:00
1 0 a 26/03/07 15:30:00
1 0 b 26/03/07 15:30:00
1 0 c 26/03/07 15:30:00
1 1 a 26/03/07 16:00:00
1 1 b 26/03/07 16:00:00
1 1 a 26/03/07 16:10:00
1 1 b 26/03/07 16:10:00
2 0 a 26/03/07 17:00:00
2 0 b 26/03/07 17:00:00
2 0 a 26/03/07 17:10:00
2 0 b 26/03/07 17:10:00
2 1 a 26/03/07 18:00:00
2 1 b 26/03/07 18:00:00
2 1 a 26/03/07 18:10:00
2 1 b 26/03/07 18:10:00


I'm trying to cobble together a delete query to delete all records for a
given ID and RevNo except for the one with the latest Generated timestamp.
With the table above it would leave me with:-

ID RevNo Other Fields Generated
1 0 a 26/03/07 15:30:00
1 0 b 26/03/07 15:30:00
1 0 c 26/03/07 15:30:00
1 1 a 26/03/07 16:10:00
1 1 b 26/03/07 16:10:00
2 0 a 26/03/07 17:10:00
2 0 b 26/03/07 17:10:00
2 1 a 26/03/07 18:10:00
2 1 b 26/03/07 18:10:00


I'm using Access 2000 and I'm a dangerous novice. I need to get an idiot's
guide to SQL I think.

Any help with this would be gratefully appreciated.

Thanks in advance.

Andy
 
Allen

Many thanks for the help and the link. This will help me with a lot of other
things I'm tinkering with.

Your web site is excellent - extremely useful.

Kind regards


Andy
 

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

Similar Threads


Back
Top