Here is my exact code with the conditions to see if anyone can spot mistakes. Trying to update a column with conditions dependant on another table that is linked to the table to be updated.The error is:Syntax error (missing operator) in query expression 'IIf(D.T = "Sgt.", "Sgt.", "Trainer")FROM(SELECT C1.ReferredBy AS Ref, C3.Title AS T, C3.ContactType as CT ((FROM tblCompanies C1 INNER JOIN companycontacts C2 ON C1.CompanyID = C2.CompanyID) INNER JO'
Update query below:UPDATE DSET D.Ref = IIf(D.T = "Sgt.", "Sgt.", "Trainer")FROM(SELECT C1.ReferredBy AS Ref, C3.Title AS T, C3.ContactType as CT ((FROM tblCompanies C1 INNER JOIN companycontacts C2 ON C1.CompanyID = C2.CompanyID) INNER JOIN tblContacts C3 ON C2.ContactID = C3.ContactID) WHERE C3.Title = "Sgt." OR C3.ContactType = "Trainer") AS DWHERE D.T = "Sgt." OR D.CT = "Trainer";
Does the use of single or double quotes matter? It doesn't seem to make any difference to the error.