0
SELECT 
c.AccountId as SubscriberID
, c.DoNotCall
, c.Email
, c.FirstName as First_Name
, c.LastName as Last_Name
, c.HasOptedOutOfEmail as Email_Opt_Out
, c.Phone
, a.id
, a.RecordTypeId as Record_Type_ID 
FROM Contact_Salesforce as c
INNER JOIN Account_Salesforce as a on c.AccountId = a.id
AND a.RecordTypeId = '01550000000Zdc9CCD'

I've specified the Record_Type_ID (pulling it from the account salesforce object) but obviously missing something here, any help would be appreciated.

What I'm trying to do is pull in contacts from the contact object and their related information as well as their record type id which is an account object value and only do so when the ids match across account and contact object AND they are '01550000000Zdc9CCD' record type Id match.

0

1 Answer 1

1

The Record_Type_ID alias returned by your query is not the same as Record Type ID in the error message.

Should probably be this:

SELECT 
c.AccountId as SubscriberID
, c.DoNotCall
, c.Email
, c.FirstName as First_Name
, c.LastName as Last_Name
, c.HasOptedOutOfEmail as Email_Opt_Out
, c.Phone
, a.id
, a.RecordTypeId as [Record Type ID]
FROM Contact_Salesforce as c
INNER JOIN Account_Salesforce as a on c.AccountId = a.id
AND a.RecordTypeId = '01550000000Zdc9CCD'
2
  • thanks for clarifying. To make sure I understand correctly if I'm pulling in fields from the data extension that have spaces such as Record Type ID I would use brackets [] to contain them or is that solely since Record Type ID is a Primary Key?
    – 4kAudio
    Commented Jun 2, 2021 at 18:29
  • Doesn't necessarily relate to it being a Primary Key. Appears that field is required and because you weren't referring to the field properly (with brackets and spaces), it failed. Commented Jun 2, 2021 at 19:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .