可选的SSRS参数

问题描述 投票:-1回答:1

我有一个可选的字符串参数@PString和一个可选的整数参数@PInt,并将其设置为允许空值。有人可以帮助我使用“where”子句中的语法来考虑该参数,如果填充其他人不考虑它。谢谢。

reporting-services parameters optional
1个回答
1
投票

不是简单的

where
(isnull(@Pstring,'')='' or @Pstring = sometable.somecharcolumn)
and
(isnull(@Pint,0)=0 or @Pint = sometable.someintcolumn)

你也可以这样做

 where
    (@Pstring is null or @Pstring = sometable.somecharcolumn)
    and
    (@Pint is null or @Pint = sometable.someintcolumn)
© www.soinside.com 2019 - 2024. All rights reserved.