Anthony Sims Anthony Sims - 1 year ago 52
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 Source

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

FROM   mytable
WHERE  :input IS NULL OR :input = value