1

我想针对与客户合同相关的每个案例运行我的报告。现在,我可以在帐户级别运行报告。我使用了如下过滤视图:

dbo.FilteredAccount AS CRMAF_FilteredAccount 
on CRMAF_FilteredAccount.accountid = I.CustomerId 
WHERE A.PartyObjectTypeCode = 8 AND A.PartyIdName IS NOT NULL

我希望能够针对与合同关联的帐户的每个案例运行相同的报告。我尝试使用 FilteredIncident 视图,但我不确定我做得对。

从评论中查询:

SELECT I.CustomerIdName AS 'Customer Name',
       S.CreatedOn AS 'Task Start Date',
       S.Subject AS 'Task Performed',
       A.PartyIdName AS 'Resource',
       S.Description,
       cast((S.ActualDurationMinutes / 480) as varchar(5)) +' day(s)' + ', ' +
           cast((S.ActualDurationMinutes% 480) / 60 as varchar(2))+' hour(s)' 
           as 'Time Spent',
       S.ActualDurationMinutes AS 'Total Time',
       S.ActualDurationMinutes AS 'Total' 
FROM dbo.Incident I 
JOIN [dbo].[ServiceAppointment] S ON I.IncidentId = S.RegardingObjectId 
JOIN dbo.ActivityParty A ON S.ActivityId = A.ActivityId
4

1 回答 1

1

您需要在您的选择列表中添加一个 CaseID,并在报告中添加一个参数以与它进行比较。因此,您可以在 WHERE 子句中添加类似的内容:

WHERE I.CaseID = @SelectedCase
于 2013-04-19T23:07:57.580 回答