Hi all,
Wondering if someone can assist with a delete query I need to write.
I have a table in MS Access similar to the example shown below (TBL_PRICES) and need to delete records based on the DATE field.
For each unique PRODUCT, I need to:
• Keep all records for that PRODUCT value with a DATE on or after 8/12/16 plus
• Keep the record for each PRODUCT value with the date that is closest but earlier than 8/12/16
All other records should be deleted and the "Action" column to the right of TBL_PRICES indicates which records I want to delete as an example.
Any help would be greatly appreciated.
TBL_PRICES
----------------------------------------
DATE | PRODUCT | PRICE Action 1/01/2017 | widgets | 1.54 keep 17/12/2016 | taps | 1.85 keep 5/12/2016 | taps | 1.33 keep 15/11/2016 | widgets | 1.24 keep 5/11/2016 | taps | 1.13 delete 3/11/2016 | widgets | 1.12 delete