Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7735863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:36:23+00:00 2026-06-01T07:36:23+00:00

I have a parameter @Department and set its value in the Dataset to =Join(Parameters!Department.Value,,)

  • 0

I have a parameter @Department and set its value in the Dataset to =Join(Parameters!Department.Value,","). I set it to accept multiple values and in my SQL I have the following clause: (RTRIM(G.DeptName) IN (@Department)).

It works whenever the user selects one department, but doesn’t work at all whenever multiple departments are selected. It runs, but it doesn’t display any data. For example, if I select ‘Accounting’, it shows ‘Accounting’ info. But if I select ‘Accounting’ and ‘Marketing’, nothing shows up.

Any ideas why this isn’t working? Also, is it possible to do this in this manner with something other than “string” values?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:36:24+00:00Added an answer on June 1, 2026 at 7:36 am

    You are making a false assumption.

    IN ('1,2,3,4') is very different from IN (1,2,3,4) or IN ('1', '2', '3', '4')

    What you are currently doing it the first one. You are checking whether your department name is in a list which is only one value long; the @department string. That value has commas in it, but it’s still a single string, and so it’s still a single item in the list.

    You have two options.

    Build up the SQL dynamically so that your list is part of the sql and not a string parameter.

    Or look up one of the many SPLIT() function available on-line. This is the one I recommend. You can then do something like…

    WHERE
      RTRIM(G.DeptName) IN (SELECT * FROM dbo.split(@Department))
    

    Or even better, join on the results of the SPLIT() function…

      yourTable AS G
    INNER JOIN
      dbo.split(@department) AS department
        ON  RTRIM(G.DeptName) = department.item
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added a parameter to my report with the option Allow Multiple Values
I have a parameter string that passes date value to a stored proc cmdItemSearch.Parameters.Add(new
I have a parameter called VoucherType that can multiple values selected by the user
I have a parameter like this: rightOperand:(const NSDecimal*)rightOperand how could I provide a value
I have SQL parameter array as... SqlParameter[] sqlParams = new SqlParameter[2]; If I want
I have the following POCO Class with its Repository Pattern Implementation. If my model
I have a parameter sniffing issue in sql server 2005 for a dynamic, parameterized
How can I have a parameter to one JS function be Function Name with
I have an object parameter and I need to check if the object implements
I have a get-parameter with name controller . When I try to pass it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.