Hi Guys, I am trying to add a Delete statement to this query to Delete all dupes based on MAX(tblOdomStatement.fldDateStamp.
I cannot get an adequate response. Any ideas?
SELECT tblOdomStatement.fldVin, tblOdomStatement.fldLeaseNum, tblOdomStatement.fldDateStamp, tblOdomStatement.fldCustomerSign, tblOdomStatement.fldDealerSign, tblOdomStatement.fldGroundDate
FROM tblOdomStatement
WHERE (((tblOdomStatement.fldVin) In (SELECT [fldVin] FROM [tblOdomStatement] As Tmp GROUP BY [fldVin],[fldLeaseNum] HAVING Count(*)>1 And [fldLeaseNum] = [tblOdomStatement].[fldLeaseNum])))
ORDER BY tblOdomStatement.fldVin, tblOdomStatement.fldLeaseNum;
Thanx
Trudye
I cannot get an adequate response. Any ideas?
SELECT tblOdomStatement.fldVin, tblOdomStatement.fldLeaseNum, tblOdomStatement.fldDateStamp, tblOdomStatement.fldCustomerSign, tblOdomStatement.fldDealerSign, tblOdomStatement.fldGroundDate
FROM tblOdomStatement
WHERE (((tblOdomStatement.fldVin) In (SELECT [fldVin] FROM [tblOdomStatement] As Tmp GROUP BY [fldVin],[fldLeaseNum] HAVING Count(*)>1 And [fldLeaseNum] = [tblOdomStatement].[fldLeaseNum])))
ORDER BY tblOdomStatement.fldVin, tblOdomStatement.fldLeaseNum;
Thanx
Trudye