SELECT
ActivityPartyBase.PartyId AS ContactId,
ActivityPartyBase.ActivityId AS PhoneCallId
FROM
CampaignActivityBase
INNER JOIN ActivityPointerBase
ON (ActivityPointerBase.RegardingObjectId = CampaignActivityBase.ActivityId)AND (ActivityPointerBase.DeletionStateCode = 0)
INNER JOIN PhoneCall
ON ((PhoneCall.ActivityId = ActivityPointerBase.ActivityId) AND (ActivityPointerBase.StateCode = 0) AND (PhoneCall.DeletionStateCode = 0))
INNER JOIN ActivityPartyBase
ON ((PhoneCall.ActivityId = ActivityPartyBase.ActivityId) AND (PartyObjectTypeCode = 2))
INNER JOIN ContactBase
ON (ContactBase.ContactId = ActivityPartyBase.PartyId) AND (ContactBase.DeletionStateCode = 0)
WHERE
(CampaignActivityBase.ActivityId = @CampaignActivityId)
2009-08-12
How to get a PhoneCallId
Подписаться на:
Комментарии к сообщению (Atom)
Комментариев нет:
Отправить комментарий