I want to Select * from ##TN008LMSH11 that do not exists ON Customer,
but IF there IS more than one record I want only the LAST ##TN008LMSH11.ChangedateTime.
The following query is bringin me all duplicate recors as well.
SELECT t.CustID, t.CampaignID, t.Office,
t.LastName, t.FirstName, t.MiddleInitial, t.AddressLine1,
t.AddressLine2, t.SSN, t.City, t.State, t.HomePhone,
t.Zip, t.ResidCD, t.ResidDate, t.EmployerName, t.JobTitle,
t.EmploymentDate, t.WorkPhone, t.OtherPhone, t.BTTC,
t.BTTCCode, t.EmailAddress, t.CustType, t.ChangeDateTime
FROM ##TN008LMSH11 t LEFT JOIN Customer c
ON t.CustID=c.CustID AND
t.CampaignID=c.CampaignID AND
t.Office=c.Office
WHERE c.CustID IS NULL
do you have a suggestion on how to do it? AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"
but IF there IS more than one record I want only the LAST ##TN008LMSH11.ChangedateTime.
The following query is bringin me all duplicate recors as well.
SELECT t.CustID, t.CampaignID, t.Office,
t.LastName, t.FirstName, t.MiddleInitial, t.AddressLine1,
t.AddressLine2, t.SSN, t.City, t.State, t.HomePhone,
t.Zip, t.ResidCD, t.ResidDate, t.EmployerName, t.JobTitle,
t.EmploymentDate, t.WorkPhone, t.OtherPhone, t.BTTC,
t.BTTCCode, t.EmailAddress, t.CustType, t.ChangeDateTime
FROM ##TN008LMSH11 t LEFT JOIN Customer c
ON t.CustID=c.CustID AND
t.CampaignID=c.CampaignID AND
t.Office=c.Office
WHERE c.CustID IS NULL
do you have a suggestion on how to do it? AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"