Hi again,
I found how to eliminate duplicate contacttypes for the same fkProjectID as below, keeping the newest by DateCreated. So now I think I only have to delete the 'firstcontact' if I have a 'secondcontact' for the same fkProjectID. Please advise if I am going about this the right way. I try to break the problem down into pieces.
DELETE FROM T1
FROM #header T1, #header T2
WHERE T1.fkProjectID = T2.fkProjectID
AND T1.ContactType = T2.ContactType
AND T1.DateCreated < T2.DateCreated
Warm regards,