Link to home
Start Free TrialLog in
Avatar of thayduck
thayduckFlag for United States of America

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,2015-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
ASKER CERTIFIED SOLUTION
Avatar of Jose Torres
Jose Torres
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thayduck

ASKER

Perfect.

Thank You...