[英]Student seeking help for SSRS filter
I'm using SSRS. 我正在使用SSRS。 I'm trying to setup a filter that functions as a phone number search. 我正在尝试设置一个用作电话号码搜索的过滤器。 If there is no phone number, it could be null and otherwise search entered phone number. 如果没有电话号码,则可以为空,否则搜索输入的电话号码。 I've attached my code below. 我在下面附加了我的代码。
declare @phonein varchar (50)
set @phonein = ''
select d.MethodTitle, d.Active, d.ReferralMethodID, s.TollFreePhoneID, s.Phone, s.AdminModifyDateTime
from tReferralMethod as d
inner join tTollFreePhone
as s
on s.ReferralMethodID = d.ReferralMethodID
where s.phone = @phonein
I'm at a standstill at the last line, I think. 我认为我在最后一行停滞不前。
要使用空参数值查找电话号码为空的记录,请使用
where (@phonein IS NULL and s.phone IS NULL) OR (s.phone = @phonein)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.