In case you would like to experiment before the release of the KB article,
Select ProductID,
ProductName,
ProductType
FROM Products WHERE ProductName = @ProductName! OR @ProductName! = 'ALL'
AND ProductType = @ProductType! OR @ProductType! = 'ALL'
The reason for using ‘ALL‘ is that we are considering that you would certainly use a dropdown list to let the user select product name and type. In that respect, ‘ALL’ is a meaning full value for selecting all products and/or types. In the KB we’ll show you how to achieve the same filtering at the list level rather than in a “sqlQuery” which is much faster when the filter would only return a few items.
Adding ‘ALL’ to the parameters values can be easily done by using something like the following query in another dataset:
SELECT ‘ALL’ as ProductName
UNION
SELECT DISTINCT ProductName FROM Products
Regards,