I'm trying to update a Contacts_List
table with the last activity date which in the Opened
table. So I am doing an inner join for the Opened
table with another table which has a common column and then doing another inner join with the contacts list. I'm not sure why but i keep getting the following error.
Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'inner'.
Please help!
My code:
UPDATE [dbo].[Contacts_List]
SET [LAST_ACTIVITY_DATE] = MAX(Opened.EvntCptrdDt)
WHERE [LAST_ACTIVITY_DATE] != MAX(Opened.EvntCptrdDt)
INNER JOIN [dbo].[Intrctn] R (nolock) ON Opened.IntrctnSK = R.IntrctnSK
INNER JOIN [dbo].[Contacts_List] C (nolock) ON R.CustEmailID = C.Email_id
GROUP BY Opened.IntrctnSK, R.IntrctnSK, R.EmailAdrText
the other question posted is for a single inner join..im not sure how to do 2 inner joins in an UPDATE statement