I have a table with grocery items, brands, and expiration dates:
Item | Brand | Expiration Date |
---|---|---|
Milk | Daisy | 10/01/2024 |
Milk | Daisy | 12/01/2024 |
Milk | Duke | 10/01/2024 |
Milk | Duke | 12/01/2024 |
Eggs | Daisy | 10/01/2024 |
Eggs | Daisy | 12/01/2024 |
Eggs | Duke | 10/01/2024 |
Eggs | Duke | 12/01/2024 |
I’m trying to use SQL (in Microsoft Access) to get the max expiration date for each unique item/brand combo and get the following result:
Item | Brand | Expiration Date |
---|---|---|
Milk | Daisy | 12/01/2024 |
Milk | Duke | 12/01/2024 |
Eggs | Daisy | 12/01/2024 |
Eggs | Duke | 12/01/2024 |
I don’t know why this simple problem is tripping me up. I can use DISTINCT to get a list of unique Item/Brand combos, and then somehow join that with MAX Expiration Date? I don’t know how to put these two elements together. The full list has many different expiration dates so I can’t just use WHERE Expiration Date = 12/01/2024. Thanks