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

  • Home
  • SEARCH
  • 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 8990215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:27:11+00:00 2026-06-15T22:27:11+00:00

I am using SSRS 2005. I created a report parameter named icVar. What should

  • 0

I am using SSRS 2005. I created a report parameter named icVar. What should i do to allow this filter to be optional. Meaning if user enter something into the textbox, will display result according to what is entered but if nothing is entered it will just treat it to display all. This is the query in my dataset.

SELECT PASS_M, ENTRY_DT, EXIT_DT, WORKED_HRS, ACCESS_LOCATION_X, IC_N, COMPANY_M,  
CONSECUTIVE_D
FROM TEMP_TARGET
WHERE (CONSECUTIVE_D >= @consecDays) AND (ENTRY_DT BETWEEN @startDate AND @endDate) AND
(ACCESS_LOCATION_X LIKE @accessVar) AND
(IC_N LIKE @icVAr) 

I am making use of the wildcard % for my icVar. So if user input S123 for that filter the report will display result where IC_N values starting with S123… However when nothing is entered for that filter, do not force the user to input anything. It shall show IC_N Like %(means all) if nothing is entered.

Any help is appreciated. Thanks.

  • 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-15T22:27:13+00:00Added an answer on June 15, 2026 at 10:27 pm

    Just use expression evaluation short-circuiting – test for Null first and only if it is not Null does the next part of the expression evaluate, testing for LIKE (see the condition on the last line):

    SELECT PASS_M, ENTRY_DT, EXIT_DT, WORKED_HRS, ACCESS_LOCATION_X, IC_N, COMPANY_M, CONSECUTIVE_D
    FROM TEMP_TARGET
    WHERE (CONSECUTIVE_D >= @consecDays) 
    AND (ENTRY_DT BETWEEN @startDate AND @endDate) 
    AND (ACCESS_LOCATION_X LIKE @accessVar) 
    AND ((@icVar IS NULL) OR (IC_N LIKE @icVAr))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a report using the wizard in SSRS (VS 2008). I wasnt asked
I'm using a barcode font (IDAutomationMC39H) in an SSRS 2005 report I'm developing, and
I can't believe this - I just starting developing an SSRS report, using a
I have two reports built using SSRS 2005. The first report is set to
I am using SQL 2005 reporting services (SSRS) with the web report viewer control.
I have developed a report using SSRS 2005. Report has 5 parameters. 4 of
I have a report, which is developed in SSRS 2005 and i am using
I have reports created using Visual Studio 2005 targeted to SSRS 2005. If I
On my reporting application which is developed using SSRS 2005, I have a parameter
I'm using SSRS 2008 (NOT R2) I have a report deployed to a dev

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.