Can't find this specific topic, but I load in prices for parts using a query and linked Excel. Sometimes, I pull in parts with the same part number, quantity (price break), and unit of measure. Depending on the competition, the unit price will be different. I only care about the cheapest unit price of course. So how would I set up my criteria to find the minimum of duplicate records (by part number), and delete all other related records?
I already have my duplicate record finder based on Part number, quantity, and unit of measure (in case of bulk items):
In (SELECT [PartNumber] FROM [Pricing] As Tmp GROUP BY [PartNumber],[Quantity],[UOM] HAVING Count(*)>1 And [Quantity] = [Pricing].[Quantity] And [UOM] = [Pricing].[UOM])
Now I want to take the results of this query, and for all records where part numbers are equal (because this query finds ALL parts where there are duplicate quantities and UOM), delete all from my Pricing table if the unit price is not the smallest out of the lot. I feel like this is easier than I'm making it out to be, but I've never used Min/Max functions in Access so I'm unfamiliar with the syntax/usage.