Anthony Sims Anthony Sims - 7 months ago 4
SQL Question

How to return all values in a table when no parameter info is selected by user

I would like to create parameters in SSRS that return all values in the table if no specific values are selected by the user. I'll make the prompt say something like: "Leave blank to view all info".

Answer

You could explicitly check for a null there. E.g., assuming the column is value and the input variable is :input:

SELECT *
FROM   mytable
WHERE  :input IS NULL OR :input = value
Comments