when i try to include the idn in the query it messes up the query and ALL records are shown instead of just the minimum cost for PN_id
Patrick Matthews
SELECT t1.idn, t1.PN_id, t1.CostFROM tblPNPrice t1 INNER JOIN (SELECT t2.PN_id, Min(t2.Cost) AS MinCost FROM tblPNPrice t2 GROUP BY t2.PN_id) AS x ON t1.PN_id = x.PN_id And t1.Cost = x.MinCostORDER BY t1.idn, t1.PN_id
SELECT blPNPrice.PN_id, Min(blPNPrice.Cost) AS MinOff2
FROM blPNPrice
GROUP BY blPNPrice.fPN_id;