1. Welcome! Please take a few seconds to create your free account to post threads, make some friends, remove a few ads while surfing and much more. ClutchFans has been bringing fans together to talk Houston Sports since 1996. Join us!

[SQL Gurus] How to define a search parameter value

Discussion in 'BBS Hangout' started by Precision340, Nov 8, 2013.

Tags:
  1. Precision340

    Precision340 Member

    Joined:
    Apr 4, 2007
    Messages:
    3,481
    Likes Received:
    37
    I'm working on a SQL report and am returning a list of values for a column/field, "STATUS", to be used as one of the search parameter.

    SELECT DISTINCT STATUS FROM
    ORDER BY STATUS

    Values returned are [blank], approved, onhold, etc.

    How can I get the [blank] value to be set as "All" within the report parameter for STATUS?

    Thanks for any help! Much appreciated.
     
  2. SwoLy-D

    SwoLy-D Member

    Joined:
    Jul 20, 2001
    Messages:
    37,618
    Likes Received:
    1,456
    Ummm... post an example of what you have so far. :cool:

    It seems like you want an IF construct that matches all but becomes true if else.
     
  3. Ron from the G

    Joined:
    Feb 14, 2008
    Messages:
    1,091
    Likes Received:
    77


    I think something like this is what you are looking for:

    case when [status] = 'something here'
    then 'something different'
    else [status]
    end as 'Probably Status',
     
    1 person likes this.
  4. Precision340

    Precision340 Member

    Joined:
    Apr 4, 2007
    Messages:
    3,481
    Likes Received:
    37
    I'm using the below statement in the report dataset to return a list of values to be used in a report as a parameter selection for the field Status. The parameter shows a list of available statuses.. the list shows [blank] (blank selection returns all statuses), approved, onhold, and other statuses which are not blank. I need to have the blank selection show as "All" within the report drop down list for the parameter Status.

    SELECT DISTINCT STATUS FROM
    ORDER BY STATUS
     
  5. Precision340

    Precision340 Member

    Joined:
    Apr 4, 2007
    Messages:
    3,481
    Likes Received:
    37
    thanks Ron, will try this.
     

Share This Page

  • About ClutchFans

    Since 1996, ClutchFans has been loud and proud covering the Houston Rockets, helping set an industry standard for team fan sites. The forums have been a home for Houston sports fans as well as basketball fanatics around the globe.

  • Support ClutchFans!

    If you find that ClutchFans is a valuable resource for you, please consider becoming a Supporting Member. Supporting Members can upload photos and attachments directly to their posts, customize their user title and more. Gold Supporters see zero ads!


    Upgrade Now