开发者

SQL Server Report Builder 3.0 exclude empty fields

开发者 https://www.devze.com 2023-04-10 23:14 出处:网络
I am trying to generate reports with SQL Server Report Builder (my first time ever) And I have a list with this fields: name, order, weight, temp

I am trying to generate reports with SQL Server Report Builder (my first time ever)

And I have a list with this fields: name, order, weight, temp

Sometimes the field order has no value. And I want to filter the rows where order 开发者_如何学编程has no value!

With kind regards Marco


Are you using a dataset that has a query that you defined? If so you could base your query on the filter input. So for instance you could add a parameter to your Report Builder Report that passes in a value to your query (All, ,NotMissingOrder).

So the below takes in a param passed in from the report "@FilterParam" which as a value of NotMissingOrder if the filter is selected. This would exclude those records where Order doesn't have a value from the output. You could set the default value of the param to = 'All' So that otherwise everything would be returned:

Select *
From Table t
Where(isnull(t.Order,'MissingOrder') = @FilterParam
      Or 
      @FilterParam = 'All')
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号