我有带参数@IsMatch的SP,它检查是否
ChildPolicyNumberRater <> ChildPolicyNumberIMS
以及允许用户使用WildCard参数的参数@ChildPolicyNumber。
如果我使用参数'No Match'
在SSMS中运行SP,则会为我提供正确的数据ChildPolicyNumberRater NULLS
以及与ChildPolicyNumberIMS
不匹配的数据:
但是如果我在SSRS中运行它,它只会显示ChildPolicyNumber NULLS
的记录。
我确信我WHERE
子句中的某些内容使得SSRS显示数据与SSMS不同。但我不明白为什么!
ALTER PROCEDURE MyProcedure
@DateFrom datetime = '2017-01-30'
@DateTo datetime = '2017-03-05'
@lineGuid varchar(8000) = NULL,
@IsMatch varchar(50),
@ChildPolicyNumber varchar(50)
AS
DECLARE @TempData
INSERT INTO @TempData
SELECT ...
FROM...
WHERE
SELECT
ChildPolicyNumberIMS
,ChildPolicyNumberRater
,case when ChildPolicyNumberRater <> ChildPolicyNumberIMS or ChildPolicyNumberRater is null then 1 else 0 end as status
,MAX([InvoiceDate]) as InvoiceDate
,[CompanyGUID]
WHERE
(
ChildPolicyNumberRater like '%'+ @ChildPolicyNumber +'%'
or ChildPolicyNumberRater is null
or @ChildPolicyNumber is null
)
and (
(@IsMatch = 'No Match'
and ChildPolicyNumberRater<>ChildPolicyNumberIMS or ChildPolicyNumberRater is null)
or(@IsMatch = 'Match' and ChildPolicyNumberRater=ChildPolicyNumberIMS)
)
答案 0 :(得分:1)
在SSRS屏幕截图中,下拉列表显示&#34; Not Match&#34;而不是&#34;没有匹配&#34;。你确定要发送不匹配吗?