CASE Statement in Where Condition with Multi Valued parameter in SSRS

Hi All,
I am little confused while using CASE statement in Where condition in SSRS. Below is my scenario:
SELECT
Logic here
WHERE
Date IN (@Date)AND
(CASE
WHEN NAME LIKE 'ABC%' THEN 'GROUP1'
WHEN ID IN ('123456', '823423','74233784') THEN 'GROUP2'
WHEN ABC_ID IS NULL THEN 'GROUP3'
ELSE 'GROUP4'
END ) IN (@GROUP)
So above query uses WHERE condition with CASE statement from @GROUP parameter. I want to pass this parameter as multi- valued parameter and hence I have used CASE statement IN (@GROUP).
For @Date one dataset will pass the available and default values and
for @GROUP parameters, another dataset will pass the available and default values.
But this is not working as expected. Please suggest me where I am making mistake in the query.
Maruthu | http://sharepoint-works.blogspot.com

Hi Maruthu,
According to your description, I create a sample report in my local environment. It works as I expected. In your scenario, if the selected values from the Date parameter contains some of the Date field values, the selected values from the GROUP parameter
contains some of GROUPS (‘GROUP1’,’GROUP2’,’GROUP3’,’GROUP4’) and the corresponding when statement is executed , then the dataset returns the corresponding values.
In order to trouble shoot this issue, could you tell us what results are you get and what’s your desired results? If possible, you can post the sample data with sample dataset, then we can make further analysis and help you out.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support

Similar Messages

  • Multi-value parameter report - error : Incorrect syntax near ',' with multi-valued parameter in SSRS

    Hey,
    I created a report in Reporting Services  where I added multi-value parameter
    ( Filter).  When I run my report, and try to select more than one parameter, I get an error:  Incorrect syntax near ','
    then i put in parameter expression :  join(Parameters!Filter.Value,",")  
    and add : dbo.ufnSplit  before calling parameter in query :
    >>>  set @valwhere = 'table.field IN (select * from dbo.ufnSplit(' + @Filter + ' , '',''))'
    but i still have errors : incorrect syntax near 'text'  which is the second value of the picklist of the parameter,
    Please Any idea ?
    Thanks !!

    I have sometimes had to collate as default with the SQL query
    currently I've just using
    CompanyName in
    (selectitemfromdbo.fnSplit(@function,','))
    In the SSRS report text box I have Join(Parameters!Company.Value,",")

  • Need to display the first 5 values of a Multi value parameter in SSRS report

    Hi All,
    I have SSRS report with multi value parameter. I need to display the parameter selection values in a text box. I've more than 50 records in the multi value parameter list. I've included the code to display "All" if I choose "select
    all" option otherwise it will show the selected values. But, I need to change the logic. I have to show only the 1st 5 records if I choose more than 5 records.
    How can I implement this?
    I have used the below code
    =iif(
    Parameters!Country.Count = Count(Fields!Country.Value,
    "Country")
    ,"All"
    ,iif(Parameters!Country.Count>5
    ,"Display the 1st 5 values"
    ,Join(Parameters!Country.Value,",")
    Regards,
    Julie

    Hi Julie,
    Per my understanding that you want to always show the first values from the param country to a textbox when you have select more then five values from the dropdown list, if you checked "select all", textbox will display "All", if
    you select <=5 amount of values. it will display the selected values, right?
    I have tested on my local environment and that you can create an hide parameter(Param2) to display just the first five values from the Country and when you select more then five values from country you will get the Join(Parameters!Param2.Value,",")
    to display.
    Details information below for your reference:
    Create an new DataSet2 which the Param2 will get the values from:
    SELECT     TOP (5) Country
    FROM        tablename
    Create an new param2 and hide this parameter, Set the "Available values" and "Default values" by select the "Get the values from a query"(DataSet2)
    You can also Specify first five value for the "Available values" and "Default values", thus you will not need to follow the step1 to create the dataset2
    Modify the expression you have provided as below:
    =iif(Parameters!Country.Count = Count(Fields!Country.Value, "DataSet1"),"All" ,iif(Parameters!Country.Count>5 ,Join(Parameters!Param2.Value,","),Join(Parameters!Country.Value,",")))
    Preview like below
    If you still have any problem, please feel free to ask.
    Thanks, 
    Vicky Liu
    If you have any feedback on our support, please click
    here.
    Vicky Liu
    TechNet Community Support

  • How to set the default selection to "Select All" in a Multi valued parameter in SSRS 2008?

    Hello Everyone,
    How to set the default selection  to "Select All" in a Multi valued parameter in SSRS 2008?
    Regards
    Gautam S
    Regards

    You need to specify "Default Values" in the report parameter property. Choose similar option used in the "Available Values" option, this will allow the parameter to check "Select All".
    Regards, RSingh

  • Display Blank Tablix when using multi value parameter in SSRS 2008 R2

    I have a main report which contains tablix1 and tablix2. Tablix1 is using DataSet1 and Tablix2 is using DataSet2. I have a multi value parameter set up with 71 items to choose from. My company owns 71 convenience stores and what I am doing is comparing sales
    for a hard coded date in DataSet1 versus a hard coded date in DataSet2, sales for the same date 1 year ago. Pretty simple, works great when both datasets return data. However, we have a store that we opened up about 4 months ago. The data is displayed
    in Tablix1, but since the store did not exist 1 year ago, there is no data for Tablix2. I have tried the "No Row Message" and Repeating Column and Row Headers, etc. When I choose all stores that existed last year, the report runs great. When I choose
    a store that existed last year and our new store (#39) that did not, the report messes up. The below image, you can see Tablix1 is good, but Tablix2 should be blank and only show the column headers. Instead it moved Store #40's Tablix1 beside it. If I
    run the report and just select store #39, Tablix1 runs as it should and Tablix2 shows The column headers and a blank row. It disappears as soon as I select multiple values.
    When you click the next page button, you will see Store 40's Tablix2 where it's Tablix1 should be and then a blank space where Tablix2 should be.

    Hi BassMan75,
    According to your description, there is a main report with subreport, since the store did not exist one year ago, there is no data for the subreport. You want to show tablix grid even through there is no data in subreport, right?
    Report data comes from datasets, if there is no corresponding value in the dataset, only column headers will be displayed in the report, we could not set the rows to blank, so we can’t achieve your goal directly. As a workaround, we can put one text box
    in the report with the message: No data for the store. In this way, if there is no data meets search condition, the message will be displayed in the report. Please refer to the following steps:
    Click and select the tablix.
    In Properties window, in No Rows section, in NoRowsMessage text box, type No data for the store.
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • How to sort via multi value parameter in ssrs

    I have a parameter with multi values. when the user selects ,he get of options like acount name, first name, last name.
    so if user selects firstname , the data has to sort by firstname.
    if he selects acount name , the data has to sort by account name.
    please help me how to sort the data using parameter with multivalue? in ssrs 2008.
    Thank you?

    Hi Venku,
    Based on your description, it seems that you create a parameter with available values and you want to sort the report data based on the parameter value. If the available values are the field names in the report, you can try to open the Tablix properties
    dialog box and specify the sort expression on "Sorting" tab as follows:
    =Fields(Parameter!parametername.value).value
    If the parameter allow multiple values and you want to sort the report data by more than one field, for example, sort the report data by "accountname" and then by "firstname", please add two sort expressions as follows:
    =Fields(Parameter!parametername.value(0)).value
    =Fields(Parameter!parametername.value(1)).value
    If you have any question, please let me know.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Multi Value Parameter in SSRS

    Hi,
    I have a parameter "MyTeam" (multi-select) which is a list of users.
    I also have P1,P2,P3,P4,P5 as additional parameters.
    My requirement is , When I select only 1 value in "MyTeam" , P1 should be filled with value selected and P2,P3,P4,P5 should contain "00-000-00".When I select 2 values in "MyTeam" , P1 & P2 should be filled with respective
    values and P3,P4,P5 should contain "00-000-00".
    I am using the below expression on P2,P3,P4,P5 and changing the Count  accordingly, but it doesn't seem to work and I get the error below.....!!!
    Example : This expression is for P2 and I am selecting only 1 value in "MyTeam".
    =iif(Parameters!MyTeam.Count >= 2, Parameters!MyTeam.Value(1),"000000-00000000")
    The Value expression  contains an error: Index was outside the bounds of the array.
    When I change my expression to =iif(Parameters!MyTeam.Count >= 2, "TRUE","FALSE")
    , I get no error.
    How do I resolve this..??
    Thanks Uma.K

    Hi kanumuri1987,
    According to your description, you want to create a multivalued parameter, when you select some values from the drop-down list, other unselected values should be set to "000000-00000000".
    In Reporting Services, if we have specified available values for a parameter, after processing parameter values, we can select expected values from drop-down list, at this time, those parameter values are fixed and they can’t be changed. So for your requirement,
    it can’t be achieved currently.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Case Statement in Where Condition

    Dear All,
    In my table Fields are
    EmpId
    TranYear
    TranMonth
    ApprovedBy
    ApprovedYear
    ApprovedMonth
    My Input parameters are
    1. TranYear
    2. TranMonth
    3. Tag1
    4. Tag2
    My requirement is
    Tag1 Input are 0,1,2
    Tag2 Inputs are 0,1,2
    If Tag1 is 0 then checking TranYear/TranMonth And
    Tag2 Is 0 Then ApprovedBy Is Not Null only
    Tag2 Is 1 Then ApprovedBy Is Null only
    Tag2 Is 2 Then both(Approved/unApproved)
    If Tag1 is 1 then checking ApprovedYear/ApprovedMonth And Tag2 Passing 0 Default
    If Tag1 is 2 then checking TranYear/TranMonth Or ApprovedYear/ApprovedMonth And
    Tag2 Is 0 Then ApprovedBy Is Not Null only
    Tag2 Is 1 Then ApprovedBy Is Null only
    Tag2 Is 2 Then both(Approved/unApproved)
    Based upon the input details select details

    CASE expression evaluates to a scalar value. Therefore you can use CASE in place of a scalar value anywhere in a T-SQL query.
    CASE expression examples:
    http://www.sqlusa.com/bestpractices/training/scripts/casefunction/
    BOL on CASE: http://msdn.microsoft.com/en-us/library/ms181765.aspx
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to make multi value parameter optional in SSRS

    I HAVE REPORT IN SSRS 2005.
    I have @strjournal as multi value parameter. Allow blank is checked. Parameter values r assigned through query.
    select jornalno,jornalno as descr from tran_table 
    union select 'NULL','NULL' 
    So for @strjournal,  valuefield = jornalno  , label field = descr
    my main query i am giving,
    select .... from myTable where  (TRANKEY IN (@strjournal) AND @strjournal<> 'NULL' ) OR (TRANKEY LIKE '%' AND @strjournal = 'NULL')
    If i select 'NULL' its giving me correct result (returning all records as condition is like '%')
    if i select only 1 journalno (not 'NULL') also giving me correct result (i.e. only 1 record for which jornalno is selected)
    if i select more than 1 jornalnos then its giving me error "an expression of non boolean type specified in a context where condition is expected , near ',' "
    Any help ??
    h2007

    I have report in SSRS 2005 with multi value parameter.
    @strjournal is multi value parameter. Allow blank is checked. Values r assigned by below query
    select journalno,journalno as descr from tranTable
    union
    select 'NULL','BLANK'
    so for @strjournal, value field = journalno and label field = descr
    My main query is,
    select ---- from mainTable where
    (TRANKEY IN (@strjournal) AND @strjournal<> 'NULL' ) OR (TRANKEY LIKE '%' AND @strjournal = 'NULL')
    if i select 'NULL' gives me correct result (returns all rows as condition is like '%')
    if i select only 1 journalno (not 'NULL') also gives me correct result (returns only 1 record for which journalno is selected)
    if i select more than 1 journal nos gives me error, An expression of non-boolean type specified in a
    context where a condition is expected, near ',' 
    if i select more than 1 values (though i have selected it as multi-value) its giving me error.
    if i just give condition, 
    select ---- from mainTable where (TRANKEY IN (@strjournal)) 
    then i can select multiple
    h2007

  • Case statement in where clause ??

    Hello gurus,
    Can we use case statements in where clause ?? Any example will be great!
    And also i would like to know, besides CASE and DECODE statements, Is there any way we can use IF ELSE statements in SELECT clause or in WHERE clause ?
    Thank you!!

    Hi,
    user642297 wrote:
    Hoek,
    Thanks for the reply
    Whatever you return from 'then' should match your criteria.I didnt get this part...can you elaborate this part ?? Thank you!!Remember what a CASE expression does: it returns a single value in one of the SQL data types (or NULL).
    You're probably familiar with conditions such as
    WHERE   col = 1Inthe example above, col could be replaced by any kind of expression: a function call, and operation (such as "d * 24") or a CASE expression, which is exactly what Hoek posted:
    where  case
             when col = 6 then 1
             when col = 9 then 1
           end = 1;I think what Hoek meant about mnatching was this: since the CASE expression is being compared to a NUMBER, then every THEN clause (as well as the ELSE, if there is one) should return the same data type. You can't have one THEN clause return a NUMBER, and another one in the same CASE expression return a DATE, like this:
    where  case
             when col = 6 then 1
             when col = 9 then SYSDATE     -- WRONG! Raises ORA-00932: inconsistent datatypes
           end = 1; 
    By the way, it's rare when a CASE expression really helps in a WHERE clause. CASE is great for doing conitional stuff in places where you otherwise can't (in the ORDER BY clause, for example), but the WHERE clause was designed for conditions.
    Hoek was just trying to give a simple example. If you really wanted those results, it would be simpler to say:
    where  col = 6
    or     col = 9and simpler still to say
    where  col  IN (6, 9)

  • Case statement within where clause

    How can i write a case statement within Where clause of SQL statement.
    Ex:
    If sysdate is less than Dec 31 of 2009 then run the query for 2009 else run the query for 2010.
    belwo query is not working. Please let me know how can i write a case statement within where clause.
    Select * from table
    where
    Case
    when to_char(sysdate,'yyyymmdd')<=20091231 then tax_year=2009
    else tax_year=2010
    End

    Hi,
    You can get the results you want like this:
    Select  *
    from      table
    where   tax_year = Case
                      when  to_char(sysdate,'yyyymmdd') <= 20091231
                      then  2009
                      else  2010
                 End
    ;A CASE expression returns a single value in one of the SQL data types, such as a NUMBER, VARCHAR2 or DATE. There is no boolean type in SQL.

  • Using where condition with dynamic internal table

    Hi Friends.
    How to use where condition with dynamic internal table ?
    Regards,
    Amit Raut

    Hai Amit
    REPORT  ZDYNAMIC_SELECT                         .
    TABLES: VBAK.
    DATA: CONDITION TYPE STRING.
    DATA: BEGIN OF ITAB OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    END OF ITAB.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
    CONCATENATE 'VBELN' 'IN' 'S_VBELN.'
    INTO CONDITION SEPARATED BY SPACE.
    SELECT VBELN POSNR FROM VBAP INTO TABLE ITAB
    WHERE (CONDITION).
    LOOP AT ITAB.
    WRITE 'hello'.
    ENDLOOP.
    Thanks & Regards
    Sreenivasulu P

  • Multi value parameter sniffing

    DECLARE
    @w1_p int,
    @w2_p int,
    @month_p int,
    @usdTHISweek_p float,
    @usdLASTweek_p float,
    @MASS_KIB_p nvarchar(max),
    @branch_eq_ccode_p nvarchar(max)
    set @w1_p=@w1
    set @w2_p=@w2
    set @month_p=@month
    set @usdTHISweek_p=@usdTHISweek
    set @usdLASTweek_p=@usdLASTweek
    set @MASS_KIB_p=@MASS_KIB
    set @branch_eq_ccode_p=@branch_eq_ccode
    select a.* from
    (SELECT
    case when cat.NAME='MASS' then 'MASS' else 'КИБ' end as mass_kib,
    cb.NAME_GEN as oper_typeGEN,
    cb.NAME as oper_type,
    case when br.name is null then 'не определен' else br.name end as BRANCH_EQ_CCODE,
    case when cat.NAME is null then 'Прочие' else cat.NAME end as 'segm',
    t.END_PRD_ID,
    sum(case when END_PRD_ID=@w1_p then t.FACT_WEEK else 0 end) as 'w1',
    sum(case when END_PRD_ID=@w2_p then t.FACT_WEEK else 0 end) as 'w2',
    sum(case when END_PRD_ID=@w1_p then t.FACT_MONTH else 0 end) as 'this week_month',
    sum(case when END_PRD_ID=@w1_p then t.PLAN_MONTH else 0 end) as 'plan_month',
    null as 'month_fact',null as 'month_plan',null as 'month_endprdid',
    sum(case when END_PRD_ID=@w1_p then t.FACT_YEAR else 0 end) as 'fact_year',
    sum(case when END_PRD_ID=@w1_p then t.PLAN_YEAR else 0 end) as 'plan_year'
    FROM [ODS_REPLICA].[stg].[CBClient_week] t
    inner join (select * from hnd.OLI_CBMEASID where RB_flag=1) cb on t.CB_MEAS_ID=cb.CB_MEAS_ID and t.BUSINESSTYPE_UK=cb.BUSINESSTYPE_UK
    left join stg.client cl on t.CLT_PIN_CD=cl.k_client and t.EN_BRANCH_ID=cl.branch_id
    left join hnd.OLI_BRANCH br on t.BRANCH_EQ_CCODE=br.BRANCH_EQ_CCODE
    left join hnd.OLI_CAT cat on cl.CAT=cat.CAT
    where END_PRD_ID=@w1_p and end_prd_id=@w2_p
    group by t.END_PRD_ID,cb.NAME,cb.NAME_GEN,cat.NAME,br.name
    union all
    SELECT
    case when cat.NAME='MASS' then 'MASS' else 'КИБ' end as mass_kib,
    cb.NAME_GEN as oper_typeGEN,
    cb.NAME as oper_type,
    case when br.name is null then 'не определен' else br.name end as BRANCH_EQ_CCODE,
    case when cat.NAME is null then 'Прочие' else cat.NAME end as 'segm',
    null,
    null,null,null,null,
    sum(t.FACT_MONTH),
    sum(t.PLAN_MONTH),
    t.END_PRD_ID,null,null
    FROM [ODS_REPLICA].[stg].CBClient_month_since2012 t
    inner join (select * from hnd.OLI_CBMEASID where RB_flag=1) cb on t.CB_MEAS_ID=cb.CB_MEAS_ID and t.BUSINESSTYPE_UK=cb.BUSINESSTYPE_UK
    left join stg.client cl on t.CLT_PIN_CD=cl.k_client and t.EN_BRANCH_ID=cl.branch_id
    left join hnd.OLI_CAT cat on cl.CAT=cat.CAT
    left join hnd.OLI_BRANCH br on t.BRANCH_EQ_CCODE=br.BRANCH_EQ_CCODE
    where END_PRD_ID=@month_p
    group by t.END_PRD_ID,cb.NAME,cb.NAME_GEN,cat.NAME,br.NAME
    )a
    where a.branch_eq_ccode in (@branch_eq_ccode_p) and a.MASS_KIB in(@MASS_KIB_p)
    Hi! I`m having great trouble sniffing multi-value parameter.
    The problem is that the query runs in SSMS about 5 seconds and in SSRS about 1 minute.
    My multi valued parameters are below. I added fx (="'" + JOIN(Parameters!MASS_KIB.Value, "','") + "'") in the parameters options for the dataset, but the results of the query are blank.
    I feel like i`m wrong with all the sp_exec and N'....stuff. 
    Please help me with that.
    Oleg
    @branch_eq_ccode_p,@MASS_KIB_p

    As I understand the filter condition is not correct.
    you need to make it as below for multi parameter to work correctly
    CREATE TABLE #branchcodes
    BranchCode varchar(50)
    INSERT #branchcodes
    SELECT Val
    FROM dbo.ParseValues(@branch_eq_ccode_p,',')
    CREATE TABLE #MASSKIBs
    MASSKIB varchar(50)
    INSERT #MASSKIBs
    SELECT Val
    FROM dbo.ParseValues(@MASS_KIB_p,',')
    SELECT ...
    FROM ..
    INNER JOIN #branchcodes bc
    ON bc.BranchCode = ac.branch_eq_ccode
    INNER JOIN #MASSKIBs mk
    ON mk.MASSKIB = a.MASS_KIB
    Also see ParseValues here
    http://visakhm.blogspot.in/2010/02/parsing-delimited-string.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to design SSRS report to filter multi-value parameter?

    I developed an RDL which takes a multivalue parameter and I want to set a visibility expression or filter based on this parameter. This parameter uses an "All" value equal to '660E4583-7F29-4D37-8038-5096AE6A1A7F'.
    I want to make the main tablix visible if this parameter is set to this uniqueidentifier and invisible otherwise. How can I achieve this either in the tsql dataset or on the report side? I have tried numerous workarounds, but none have worked so far! I've tried
    different expressions and datatypes.
    Before I tried If/Else statements in the tsql dataset, but most recently I instead added flags to the tsql dataset for each condition and am trying to make this tablix only include the records with the flag matching the parameters chosen. But even this is not
    working for me.
    Here is sample data:
    create table #dummydata
    parameter varchar(max),
    b varchar(max)
    insert #dummydata values('660E4583-7F29-4D37-8038-5096AE6A1A7F','record 1'),('660E4583-7F29-4D37-8038-5096AE6A1vcd','record 2'),('660E4583-7F29-4D37-8038-5096AE6A1v52','record 3')
    select * from #dummydata
    And my filter expression in the RDL for this tablix is:
    =iif(Parameters!Modifier.Value(0)="660E4583-7F29-4D37-8038-5096AE6A1A7F",1,0)
    With datatype = integer and value = 1 However, this tablix is invisible with the above even when I choose "All" for the parameter value = default value. How can I make this tablix visible?
    Ryan D

    Hi Ryan D,
    After testing the scenario in my local environment, everything goes well. As per my understanding, I think this issue can be caused by the Available values in the Modifier parameter. Could you tell us the Available values of Modifier parameter in your scenario?
    The following scenario in my test is for your reference:
    I create a dataset with the sample data you posted.
    Add a multi-value parameter named Modifier in the report.
    Specify the following values in the Available Values of the parameter (please note that the value “All” should be located in the first place, because we use Parameters!Modifier.Value(0) in the filter):
    Label: All                 Value: ="660E4583-7F29-4D37-8038-5096AE6A1A7F"
    Label: A                   Value: ="1"
    Label: B                   Value: ="2"
    Label: C                   Value: ="3"
    Drag a table to the design surface, insert parameter and b fields in the table.
    Use the same expression as you said to add a filter in the tablix.
    We can refer to the following screenshot:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Parameter gets reset and Multi-value parameter doesn't work

    Hi
    Two Issues:
    I've set the value of a Date parameter (Start Date) when moving from the home screen (Report 1) to the next screen (Report 2) as the first day of the current year (DateSerial(Year(Today),1,1). In report 2, if I try to change the Start Date to another date,
    it gets reset to the first day of the year. I had the default value set as the first day of the year and even after removing it, the Start Date gets reset.
    I've set a multi-value parameter (Area) in Report 1 that collects four integers. I pass Area to Report 2 (through Join (Parameters!Area.value,",")). I also used SPLIT (Join (Parameters!Area.value,","),",") to get the value.
    Then, in the data set, I call this parameter as "Select A1,A2,A3,B1,B2,B3 FROM TEST_VIEW WHERE ID IN (?)". But this query throws an error that the query could not be executed. I ran the same query on the server side and it runs fine.
    Note:
    We cannot reference parameter names as @area for example because the Composite Server doesn't allow that.
    Split and Join operate on strings but my parameters are of integer type. Is this an issue?
    Please help.

    1. Are setting an expression for available values of parameter in report 2? Is the value you pass a valid among the set of values?
    2. IN wont work with comma separated values. You need to parse the individual values out using a string parsing udf as a table and then join to that
    so in your case you would be like
    Select A1,A2,A3,B1,B2,B3 FROM TEST_VIEW t
    INNER JOIN dbo.ParseValues (@Area,',')f
    ON t.ID = f.Val
    ParseValues UDF can be found in below link
    http://visakhm.blogspot.in/2010/02/parsing-delimited-string.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • Can't logon to directory through sync_user, but can through Tx LDAP - Find

    Hi, I'm trying to import users into SAP from MS Active Directory using RSLDAPSYNC_USER. When running it I get the error "Could not logon to directory" with the diagnosis "The combination of user name (DN) and password transferred to the directory was

  • Can I set the dreamweaver ftp-application to show megabytes instead of bytes?

    Hi! At the moment the ftp-uploader in Dreamweaver is showing bytes when I put or get files from my site. This can be a bit confusing especially with larger files, as the numbers will easily get huge. Is there a way to view the upload/download progres

  • How Do I get Final Draft 7 to work with OSX 10.8.3 ?

    Everytime I try to open it I get this message (see attached). I can't update to Final Draft 8, so if that's your sugestion please don't respond. I heard there is something I can download to make it work? Please help! Thank you so much! Miranda

  • Dynamic (ephemeral) Port Allocation Global or per-IP?

    Due to an unfortunate application design, I am encountering an issue where I am exhausting ephemeral ports, even after increasing the range.  We have noticed the ephemeral port range seems to be allocated globally, regardless of sourceIP. This post h

  • Issue with the home buton... HELP

    So I just purchased my iPhone4 yesterday and here I am less than 24hrs later and there's an issue with the home button. Either the button won't work at all and I have to restart the phone, or its magically being held down and the voice control is act