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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:09:40+00:00 2026-06-13T03:09:40+00:00

I need to create a report that a user can toggle through data going

  • 0

I need to create a report that a user can toggle through data going from Region > District> Committee> Events. I work with set data views that I cannot change. I need to define a District and a Region, as they are not correctly defined in the database and then relate them to each other. I have come close, as I was able to assign the 17 different “DistrictCodes”- Yeah they have the Code, but not the correct descriptions- using a CASE statement to make up the Regions:

CASE WHEN DistrictCode LIKE 'DST10%' THEN 4
WHEN DistrictCode LIKE 'DST13%' THEN 2
WHEN DistrictCode LIKE 'DST1%' THEN 2
WHEN DistrictCode LIKE 'DST2%' THEN 2
WHEN DistrictCode LIKE 'DST3%' THEN 3
WHEN DistrictCode LIKE 'DST5%' THEN 3
WHEN DistrictCode LIKE 'DST7%' THEN 2
WHEN DistrictCode LIKE 'DST8%' THEN 1
WHEN DistrictCode LIKE 'DSTC4%' THEN 3
WHEN DistrictCode LIKE 'DSTC6%' THEN 2
WHEN DistrictCode LIKE 'DSTC9%' THEN 1
WHEN DistrictCode LIKE 'DT11%' THEN 4
WHEN DistrictCode LIKE 'DT12%' THEN 4
WHEN DistrictCode LIKE 'DT15%' THEN 4
WHEN DistrictCode LIKE 'DT16%' THEN 4
WHEN DistrictCode LIKE 'DT17%' THEN 4
WHEN DistrictCode LIKE 'UP17%' THEN 4
WHEN DistrictCode LIKE 'UPL11%' THEN 4
ELSE 5
END AS Region

Using the “District Descriptions” data I could create the District:

CASE WHEN DistrictDesc IN ('1' , '1A' , '1B') THEN 'District 1' 
    WHEN DistrictDesc IN ('2' , '2A' , '2B' , '2C') THEN 'District 2'
    WHEN DistrictDesc IN ('3' , '3A' , '3B') THEN 'District 3'
    WHEN DistrictDesc IN ('4' , '4A' , '4B' , '4C' , '4D' , '4E' , '4F') THEN 'District 4'
    WHEN DistrictDesc IN ('5' , '5A' , '5B' , '5C') THEN 'District 5'
    WHEN DistrictDesc IN ('6' , '6A') THEN 'District 6'
    WHEN DistrictDesc IN ('7' , '7A' , '7B') THEN 'District 7'
    WHEN DistrictDesc IN ('8' , '8A' , '8B' , '8C') THEN 'District 8'
    WHEN DistrictDesc IN ('9' , '9A') THEN 'District 9'
    WHEN DistrictDesc IN ('10' , '10A' , '10B' , '10C') THEN 'District 10'
    WHEN DistrictDesc IN ('11' , '11A' , '11B' , '11C') THEN 'District 11'
    WHEN DistrictDesc IN ('12' , '12A' , '12B' , '12C') THEN 'District 12'
    WHEN DistrictDesc IN ('13' , '13A') THEN 'District 13'
    WHEN DistrictDesc IN ('14' , '14A' , '14B' , '14C' , '14D') THEN 'District 14'
    WHEN DistrictDesc IN ('15' , '15A' , '15B' , '15C' , '15D') THEN 'District 15'
    WHEN DistrictDesc IN ('16' , '16A' , '16B' , '16C') THEN 'District 16'
    WHEN DistrictDesc IN ('17' , '17A' , '17B') THEN 'District 17'
    ELSE ISNULL (DistrictDesc,'No District')
    END AS District

This works in SSMS for returning a query, however when I preview the report in VS Report Builder I need to set Region as a Parameter for the report. Whether I set the values for region or have it retrieve the values from a query, I get multiples of 1, 2, 3, 4, and 5 (my regions) for my drop down in the preview for regions.

How can I get it to return only Once for 1,2,3,4,or 5? is there a way that I Can combine these. If I use Distinct then I would be missing some of the data wouldn’t I? I have tried using IN and listing each districtcode, but returned the same issue.

  • 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-13T03:09:42+00:00Added an answer on June 13, 2026 at 3:09 am

    Your code above is not maintainable.

    You should create a district table that maps your codes and descriptions, and join to that, and use that as your source for your parameters. This will have the twin benefits of solving your issue, and improving your query

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

Sidebar

Related Questions

Here is my situation. I need to create a report that shows each open
I'm trying to create a report that allows the user to select not only
I have to create a report that will compare values from different years. The
I'm trying to create a set of data that I'm going to write out
I need to create a simple application that would generate reports based on database
Hello ! I need to create a report like the attachment shows with Jasper
I have a Report. I need to create another one, similar to the one
I need create clone repository. but I do not know where can I get
I need create a document word with Java. And I ask, how can I
I need to create a django web portal in which users can select and

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.