![]() |
#7 |
Участник
|
День добрый. Подскажите пожалуйста. Пытаюсь реализовать предварительную фильтрацию, но ничего не получается, постоянно где то ошибки валятся.
1. Создал отчет. 2. В Параметрах создал переменную CRM_FilteredOpportunity 3. Создал датасет с таким запросом: Цитата:
DECLARE @SQL nvarchar(4000)
SET @SQL = 'SELECT name, ISNULL ((SELECT SUM(new_estimatedvaluethisyear) FROM ('+@CRM_FilteredOpportunity+') as fa where (new_mgt = FilteredBusinessUnit.businessunitid)),0) FULLVALUE, ISNULL ((SELECT SUM(new_estimatedvaluethisyear) FROM ('+@CRM_FilteredOpportunity+') as fa where (new_mgt = FilteredBusinessUnit.businessunitid) and (new_Probability = 100000000)),0) F0, ISNULL ((SELECT SUM(new_estimatedvaluethisyear) FROM ('+@CRM_FilteredOpportunity+') as fa where (new_mgt = FilteredBusinessUnit.businessunitid) and (new_Probability = 100000001)),0) F1, ISNULL ((SELECT SUM(new_estimatedvaluethisyear) FROM ('+@CRM_FilteredOpportunity+') as fa where (new_mgt = FilteredBusinessUnit.businessunitid) and (new_Probability = 100000002)),0) F2 from FilteredBusinessUnit GROUP BY name, businessunitid' EXEC (@SQL) Но вся эта связка не работает. Прошу помощи. |
|
Теги |
parameters passing, reporting services, report |
|
|