thayduck
asked on
Create SSRS variable from SQL table records
I need to create a variable in my SQL stored procedure from records in a table, and when finished will look like:
2015-10-20,2015-10-21,2015 -10-22,201 5-10-23 etc...
DECLARE @mDates VARCHAR(max)
I want the variable to mimic what a actual SSRS multi-select parameter looks like when it is inputted into a stored procedure and not contain duplicates, which is a possibility.
Lets say TABLEA contains these records (could be more could be less could be just 1 record): (max is a 30 records in this table)
2015-10-20
2015-10-21
2015-10-22
2015-10-23
2015-10-20,2015-10-21,2015
DECLARE @mDates VARCHAR(max)
I want the variable to mimic what a actual SSRS multi-select parameter looks like when it is inputted into a stored procedure and not contain duplicates, which is a possibility.
Lets say TABLEA contains these records (could be more could be less could be just 1 record): (max is a 30 records in this table)
2015-10-20
2015-10-21
2015-10-22
2015-10-23
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You...