I am trying to make a report that allows a user to input an ID and then check this ID against several payee tables to see if the value already exists. The code requires an input and then displays a value of 1 if the code already exists and a 0 if the code is available for use. This works in the SQL code when setting the ID as a query parameter, but does not appear to work when creating an SSRS report and passing a report parameter through; the report displays no data.
I have tried adding a tablix column to display the parameter for validation. This field remains blank when attempting to pass a report parameter, but does properly display when hardcoding the query parameter.
DECLARE @id varchar(8)
SELECT @id,
CASE
WHEN @id IN (
SELECT id
FROM payee_1
)
THEN 1
WHEN @id IN (
SELECT id
FROM payee_2
)
THEN 1
WHEN @id IN (
SELECT id
FROM payee_3
)
THEN 1
ELSE 0
END as validation
The SQL query produces the results I would like to see in the SSRS report. It simply shows the input ID and a 1 if not available (or a 0 if available). When input into SSRS, the report parameter never passes through as if it were a query parameter and my report ends up being blank.