Link to home
Start Free TrialLog in
Avatar of NuclearOil
NuclearOilFlag for United States of America

asked on

Microsoft Access Delete all Records from table but Max

Good Day,

I want to create a delete query to remove records other than the max appended record which is based off an autonumber  field "Current Post". I'm not to familiar with SQL or if it can be performed. I mostly just use the query design view.

I've tried creating another query grouping the values of "Current Post" by the max and then joining it to the delete query but it errors out on me because of the joined table.

I'm trying to do this because I need that table to only have the latest appended data. I've attached a database example. I'm trying to delete all the records except 13,14, 15, 16.

Any thoughts?
C--Users-rbegeny.STC-Desktop-DB-De.accdb
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NuclearOil

ASKER

Worked great Ray. Thanks for the code!