Link to home
Start Free TrialLog in
Avatar of thayduck
thayduckFlag for United States of America

asked on

Delete all records except the latestest record of a group

How would I delete all records from a table (TABLEA) except the latest record (by Action Date) for that customer number ?


Before:

Custno      ActionDate      ActionNote
F050908A      2015-09-30      A/R System value change
F123088W      2015-10-06      A/R System value change
F123088W      2015-10-05      A/R System value change
F123088W      2015-10-02      A/R System value change
F123088W      2015-10-01      A/R System value change
F123088W      2015-09-30      A/R System value change
F123090W      2015-09-30      A/R System value change
F263605A      2015-10-06      A/R System value  change
F263605A      2015-10-05      A/R System value change
F263605A      2015-10-02      A/R System value change
F263605A      2015-10-01      A/R System value change
F263605A      2015-09-30      A/R System value change
F493020D      2015-10-06      A/R System value change
F493020D      2015-10-05      A/R System value change

After:

Custno      ActionDate      ActionNote
F050908A      2015-09-30      A/R System value change
F123088W      2015-10-06      A/R System value change
F123090W      2015-09-30      A/R System value change
F263605A      2015-10-06      A/R System value change
F493020D      2015-10-06      A/R System value change
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany 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