Hi
We are using Microsoft CRM and we have exported a list of service activities to a dynamic Excel worksheet. I have attempted to insert the name of customers that are related to service activities in the worksheet. When editing the SQL query I used the following script;
SELECT activitypartycu stomer.partyidn ame,
serviceappointm ent.subject ,
serviceappointm ent.scheduledst art ,
serviceappointm ent.scheduleden d ,
serviceappointm ent.regardingob jectidname ,
serviceappointm ent.activityid ,
serviceappointm ent.scheduleddu rationminutes ,
serviceappointm ent.serviceidna me
FROM FilteredService Appointment as serviceappointm ent
INNER JOIN FilteredActivit yParty as activitypartycu stomer
ON serviceappointm ent.activityid = activityparty.a ctivityid
WHERE (serviceappoint ment.schedulede ndutc >= dbo.fn_BeginOfL astMonth(GetUTC Date()) and serviceappointm ent.scheduleden dutc < dbo.fn_EndOfLas tMonth(GetUTCDa te()) and serviceappointm ent.ownerid = N'{4DEA2FCF-D238-DB11-A907-00137259CAFC}')
It seemed to be successful however the partyid column contained the name of the owner of the service activity and below that row the name of the customer.
I am sure it is the ON statement that is giving problems. I would really appreciate any assistance.
Thanks
M
We are using Microsoft CRM and we have exported a list of service activities to a dynamic Excel worksheet. I have attempted to insert the name of customers that are related to service activities in the worksheet. When editing the SQL query I used the following script;
SELECT activitypartycu stomer.partyidn ame,
serviceappointm ent.subject ,
serviceappointm ent.scheduledst art ,
serviceappointm ent.scheduleden d ,
serviceappointm ent.regardingob jectidname ,
serviceappointm ent.activityid ,
serviceappointm ent.scheduleddu rationminutes ,
serviceappointm ent.serviceidna me
FROM FilteredService Appointment as serviceappointm ent
INNER JOIN FilteredActivit yParty as activitypartycu stomer
ON serviceappointm ent.activityid = activityparty.a ctivityid
WHERE (serviceappoint ment.schedulede ndutc >= dbo.fn_BeginOfL astMonth(GetUTC Date()) and serviceappointm ent.scheduleden dutc < dbo.fn_EndOfLas tMonth(GetUTCDa te()) and serviceappointm ent.ownerid = N'{4DEA2FCF-D238-DB11-A907-00137259CAFC}')
It seemed to be successful however the partyid column contained the name of the owner of the service activity and below that row the name of the customer.
I am sure it is the ON statement that is giving problems. I would really appreciate any assistance.
Thanks
M
Comment