简体   繁体   中英

Passing a SSRS parameter, but no records shows in my report

I have one dataset has "YES" and "NO" as value And I have created a parameter and set my dataset WHERE COMPLETED IN (@Parameter) and set allow multiple values in my parameter however, when i open my report, i dont see any of the records, and the drop down filter does not work at all

By default, i want to have both options and user allow to change yes or no or both How do i fix this? Please let me know if my question is vague i can add more details

Your @Parameter value will actually just contain a single string (assuming you're using JOIN to pass the combined parameter values).

SQL Server's STRING_SPLIT() function will do the trick for you - although it's only compatible with certain SQL versions (but you can find similar functions online that support earlier versions of SQL).

For example: @Parameter ends up being populated with a string of "0,1" - ie. both Yes and No

SELECT *
FROM YourTable
WHERE COMPLETED IN
(
    SELECT value FROM STRING_SPLIT(@Parameter, ',')
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM