I am trying to delete the duplicate row and keep the last one. But I failed the sql code is as under
SELECT First(bill.CustNo) AS [CustNo Field], Count(bill.CustNo) AS NumberOfDups, Min(bill.UnitsPrev) AS MinOfUnitsPrev, Min(bill.PayinDueDate) AS MinOfPayinDueDate, Min(bill.AfterDueDate) AS MinOfAfterDueDate, bill.CustNo
FROM bill
GROUP BY bill.CustNo
HAVING (((Count(bill.CustNo))>1));
I have 33 fields and I can not put all the fields in the query as min(). When I put min then the duplicate row not displaying the exact record. on the above sql statements. But on the basis of the above fields its ok displaying the correct duplicate records.
How I delete the entire rows from the table. I have only one table and need to delete the duplicate row.
Thanks
SELECT First(bill.CustNo) AS [CustNo Field], Count(bill.CustNo) AS NumberOfDups, Min(bill.UnitsPrev) AS MinOfUnitsPrev, Min(bill.PayinDueDate) AS MinOfPayinDueDate, Min(bill.AfterDueDate) AS MinOfAfterDueDate, bill.CustNo
FROM bill
GROUP BY bill.CustNo
HAVING (((Count(bill.CustNo))>1));
I have 33 fields and I can not put all the fields in the query as min(). When I put min then the duplicate row not displaying the exact record. on the above sql statements. But on the basis of the above fields its ok displaying the correct duplicate records.
How I delete the entire rows from the table. I have only one table and need to delete the duplicate row.
Thanks