I am trying to do an update of a field based where I am getting the data from a join between 2 other tables. Can somebody tell me what is wrong with my syntax below?
update ContactExtensionBase
set New_DateEnquiryTaken = (
SELECT l.createdon
FROM ContactBase c
inner join LeadBase l
on c.OriginatingLeadID = l.LeadID) as z
where ContactID = z.ContactID
update ContactExtensionBase
set New_DateEnquiryTaken = (
SELECT l.createdon
FROM ContactBase c
inner join LeadBase l
on c.OriginatingLeadID = l.LeadID) as z
where ContactID = z.ContactID