SSRS Parameter for Two different columns

Kimmie25 121 Reputation points
2020-12-17T19:53:03.947+00:00

Hi,
Is it possible to have a one dataset with one Parameter that fillers on two separate columns?

For example.
You have a table name staff with student ids in one column and employee id in another.
And you want your user to be able to enter either the student id or the employee id to the report.

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,935 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Joyzhao-MSFT 15,596 Reputation points
    2020-12-18T06:24:59.743+00:00

    Hi @Kimmie25 ,
    In my opinion, it depends on the data characteristic. If student ID and employ ID don't have replicated number , we could use parameter and an "OR" condition in the where clause. For the dataset, using something like :

    SELECT * FROM Table_Name  
    WHERE EmployID=@ReportPara OR StudentID= @ ReportPara  
    

    This really depends on the data . If you still find trouble in you design, you could share more detail(example show how you want to use the parameter) and sample data, so we could help further.
    Regards,
    Joy


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    What can I do if my transaction log is full?--- Hot issues November
    How to convert Profiler trace into a SQL Server table -- Hot issues November

    0 comments No comments

  2. Joyzhao-MSFT 15,596 Reputation points
    2020-12-24T09:53:08.977+00:00

    Hi,

    Has your issue been resolved?

    If you have any question, please feel free to let me know.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.