Select 'ALL' in SSRS 2000

  • DATABASE NAME:abc

    TABLE NAME:GEOGRAPHY_DIM

    COLUMN NAME: STATE

    In State i have values eg: "NJ", "DC","NY", "MI"

    In State column i need a value : "ALL"

    I need out put as: "ALL","NJ", "DC","NY", "MI"

    I need to execute this query in teradata.I

    when i run this query in SSRS2000 i need to get a Dropbox on StateName as "ALL","NJ", "DC","NY", "MI" when i select "NJ" it has to display NJ Data. when i select "ALL" it has to display data for all states.

    Please help me to get data when i select "ALL".

    Thanks in Advance

    Sharma

  • I don't know query syntax for teradata, but you need to use an expression in your query. Something like this:

    ="Select columns from tables " & IIF(Parameters!State.Value = "ALL", "", "Where state = '" & Parameters!State.Value & "'"

  • I'm not sure of the Teradata syntax either, I'm afraid, but I would construct directly it in the SQL statement this way:

    SELECT ... FROM ... WHERE StateName = @state_parameter OR @state_parameter = 'ALL'

    This is the way I achieve it in SQL server and I'm sure it can be translate it as required.

    Good luck

    Paul J

  • SSRS 2005 has an ALL option built in. Without that, consider creating a table with your states in it. Also include and additional entry in the table for 'ALL' that returns your string with all states in it....

    AL = AL

    TN = TN

    NE = NE

    ALL = AL, TN, NE, ....

    Then in your report parameter you can say

    where mystate in (@stateparm)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply