What signifies the duplicate though? Just opnumber, or opnumber and opname?For opnumber:SELECT y.opnumber, y.opname, y.value, y.[date]FROM YourTable yINNER JOIN ( SELECT MAX([date]) AS [date] FROM YourTable GROUP BY opnumber) tON y.opnumber = t.opnumber AND y.[date] = t.[date]
For both:SELECT y.opnumber, y.opname, y.value, y.[date]FROM YourTable yINNER JOIN ( SELECT MAX([date]) AS [date] FROM YourTable GROUP BY opnumber, opname) tON y.opnumber = t.opnumber AND y.opname = t.opname AND y.[date] = t.[date]
Alternatively:SELECT opnumber, opname, value, [date]FROM YourTableWHERE [date] = (SELECT MAX([date]) AS [date] FROM YourTable GROUP BY opnumber)I prefer the derived table approach though. The subquery approach requires that there aren't 2 or more rows with the same max date.Tara Kizer