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 8464185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:39:55+00:00 2026-06-10T14:39:55+00:00

I have a SSRS report which runs from a stored procedure. I’ve got 2

  • 0

I have a SSRS report which runs from a stored procedure. I’ve got 2 parameters that must be chosen. My first parameter works perfectly, but when the 2nd parameter is chosen (Rep) it gets ignored by the report and returns all the Reps.

@Town Varchar(100)
,@Rep Varchar(100)

    select 
    a.Customer
    ,a.CustName
    ,a.Rep
    ,a.Town
    ,a.Qty
    ,a.SalesType
    ,b.Qty1
    ,c.Qty2
    ......
    from #1 a
    left join #2 b
    on a.Rep = b.Rep
    and a.Town = b.Town
    and a.Customer = b.Customer
    and a.SalesType = b.SalesType
    left join #3 c
    ..........
    WHERE ('ALL' IN (@Town))    OR     (a.Town IN (@Town)) 
    and ('ALL' IN (@Rep))    OR     (a.Rep IN (@Rep))
  • 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-10T14:39:57+00:00Added an answer on June 10, 2026 at 2:39 pm

    Guessing here, but I am assuming you want the clauses for @Town and @Rep to be evaluates as a group each. To do so:

    WHERE ('ALL' IN (@Town)    OR     a.Town IN (@Town)) 
    and ('ALL' IN (@Rep)    OR     a.Rep IN (@Rep))
    

    As you have it, since each clause is stand alone, you will get short circuit behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stored procedure (which pivots and unpivots values) that runs as the
I have a report in SSRS 2008 that shows data aggregated from four levels
I have a single tablix on the SSRS report which fetches data from a
I have a reportviewer control to which I feed a SSRS report. The report
I am novice with SSRS. I have a report which should display 60 months
I have designed a tabular report in SSRS which has columns Student Name, Quarter
I have SSRS report with its own datasets coming straight from the database. I
I have a SSRS report that I have been tasked with adding a second
I have a SSRS 2008 RDL report that I deploy on our report server.
My SSRS report fetches data from my DATAWAREHOUSE. The ASP.NET application I have is

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.