Multi Value Parameters help

Hi Gurus
In the main dataset query i created a parameter "where  k.jlocat=:LOC or :LOC is null". These are ORACLE Parameters and hence the :. In another dataset i created a simple query as
select distinct jlocat as LOC
FROM TABLE1
Every thing works fine so far. Now i want to select multiple values for this i edited the @LOC parameter to select multiple values and changed my WHERE CLAUSE in the main dataset as where  k.jlocat=:LOC or :LOC='All'.
Now when i save and run the report , i cannot click on 'Select All' as it gives me an error:ORA-00907: missing right parenthesis.
I'm confused as where i'm missing the right parenthesis.Please need advice.
Thanks

Hi Pmunshi,
The error "ORA-00907: missing right parenthesis." occur when you entered a left parenthesis, but missed the closing right parenthesis; or you entered invalid data within the parentheses. Please refer to the link below to see the detail information.
http://www.techonthenet.com/oracle/errors/ora00907.php
In a Reporting Services report, if we check the "Allow Multiple values" option, than we need to change the "=" operation to "In" in the query.
where k.jlocat in(:LOC)
Besides, which features do you want to achieve by using " or :LOC="All" "? If we check the "Allow Multiple values" option, we do not add any extra query. If we select "Select All" option for this parameter, it will return all the records.
If I have anything misunderstood, please point it out.
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • [Forum FAQ] How to configure a Data Driven Subscription which get multi-value parameters from one column of a database table?

    Introduction
    In SQL Server Reporting Services, we can define a mapping between the fields that are returned in the query to specific delivery options and to report parameters in a data-driven subscription.
    For a report with a parameter (such as YEAR) that allow multiple values, when creating a data-driven subscription, how can we pass a record like below to show correct data (data for year 2012, 2013 and 2014).
    EmailAddress                             Parameter                      
    Comment
    [email protected]              2012,2013,2014               NULL
    In this article, I will demonstrate how to configure a Data Driven Subscription which get multi-value parameters from one column of a database table
    Workaround
    Generally, if we pass the “Parameter” column to report directly in the step 5 when creating data-driven subscription.
    The value “2012,2013,2014” will be regarded as a single value, Reporting Services will use “2012,2013,2014” to filter data. However, there are no any records that YEAR filed equal to “2012,2013,2014”, and we will get an error when the subscription executed
    on the log. (C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles)
    Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportParameterException: Default value or value provided for the report parameter 'Name' is not a valid value.
    This means that there is no such a value on parameter’s available value list, this is an invalid parameter value. If we change the parameter records like below.
    EmailAddress                        Parameter             Comment
    [email protected]         2012                     NULL
    [email protected]         2013                     NULL
    [email protected]         2014                     NULL
    In this case, Reporting Services will generate 3 reports for one data-driven subscription. Each report for only one year which cannot fit the requirement obviously.
    Currently, there is no a solution to solve this issue. The workaround for it is that create two report, one is used for view report for end users, another one is used for create data-driven subscription.
    On the report that used create data-driven subscription, uncheck “Allow multiple values” option for the parameter, do not specify and available values and default values for this parameter. Then change the Filter
    From
    Expression:[ParameterName]
    Operator   :In
    Value         :[@ParameterName]
    To
    Expression:[ParameterName]
    Operator   :In
    Value         :Split(Parameters!ParameterName.Value,",")
    In this case, we can specify a value like "2012,2013,2014" from database to the data-driven subscription.
    Applies to
    Microsoft SQL Server 2005
    Microsoft SQL Server 2008
    Microsoft SQL Server 2008 R2
    Microsoft SQL Server 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    For every Auftrag, there are multiple Position entries.
    Rest of the blocks don't seems to have any relation.
    So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
    Try out this snippet.
    DATA lt_data TYPE TABLE OF string.
    DATA lv_data TYPE string.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename = 'C:\temp\test.txt'
      CHANGING
        data_tab = lt_data
      EXCEPTIONS
        OTHERS   = 19.
    CHECK sy-subrc EQ 0.
    TYPES:
    BEGIN OF ty_str,
      a1 TYPE string,
      a2 TYPE string,
      a3 TYPE string,
      p1 TYPE string,
      p2 TYPE string,
      p3 TYPE string,
    END OF ty_str.
    DATA: lt_str TYPE TABLE OF ty_str,
          ls_str TYPE ty_str,
          lv_block TYPE string,
          lv_flag TYPE boolean.
    LOOP AT lt_data INTO lv_data.
      CASE lv_data.
        WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
             OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
          lv_block = lv_data.
          lv_flag = abap_false.
        WHEN OTHERS.
          lv_flag = abap_true.
      ENDCASE.
      CHECK lv_flag EQ abap_true.
      CASE lv_block.
        WHEN '[Auftrag]'.
          SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
        WHEN '[Position]'.
          SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
          APPEND ls_str TO lt_str.
      ENDCASE.
    ENDLOOP.

  • Programmatically set Multi-value parameters

    Hi, I hope someone can help.
    I have a .net web application written in VS2008.  I display reports within a report viewer object.  I currently set report parameters within code using the SetParameterValue property within the report document object before passing the document to the viewer.
    This works fine for single value parameters, but I have a report which accepts multi value parameters and I am having problems trying to find any information about if this can be done within my code.  I understand the parameter is an array, therefore am I right in thinking I can pass an array into the SetParameterValue property?
    Any help would be much appreciated.
    Thanks

    Hello Julie
    You do not mention what version of CR you are using in .NET or what version of CR the reports were written in.
    There is a fair number of good threads on this issue in the forum, see if searching comes up with anything.
    Also, use the search box at the top right corner. That will search KBases, articles, Blogs, wikis, etc., etc.
    Oh and sample apps are here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    and the [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23] is a great article to go through.
    - Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Setting multi-value parameters using ReportExecutionService

    Does anyone know how to set multi-value parameters using ReportExecutionService in C#?
    If I have
    rsExec = new ReportExecutionService2005.ReportExecutionService();
    ReportExecutionService2005.ParameterValue[] parameters = new ReportExecutionService2005.ParameterValue[2];
    parameters[0] = new ReportExecutionService2005.ParameterValue();
    parameters[0].Label = "Report_Begin_Date";
    parameters[0].Name = "Report_Begin_Date";
    parameters[0].Value = "4/15/2007";
    parameters[1] = new ReportExecutionService2005.ParameterValue();
    parameters[1].Label = "SalesID";
    parameters[1].Name = "SalesID";
    parameters[1].Value = ???  //Here, this parameter should accept multiple values like 200, 201, 202, etc.
    rsExec.SetExecutionParameters(parameters, "en-us");
    How would I set the SalesID to take multiple values?

    hi
    how to set dynamic parameters values.
    please help me.
    reportexe.
    ParameterValue[] parameters =
    new reportexe.ParameterValue[5];
    if (_parameters.Length > 0)
    parameters[0] =
    new reportexe.ParameterValue();
    parameters[0].Label =
    "mgrid";
    parameters[0].Name =
    "mgrid";
    parameters[0].Value =
    "[DMMGR001MT].[MGR ID].&[10]";
    parameters[1] =
    new reportexe.ParameterValue();
    parameters[1].Label =
    "locid";
    parameters[1].Name =
    "locid";
    parameters[1].Value =
    "[DMDPT001MT].[DPT ID].&[700]";
    //[DMDPT001MT].[DPT ID].&[700] 
    parameters[2] =
    new reportexe.ParameterValue();
    parameters[2].Label =
    "usrid";
    parameters[2].Name =
    "usrid";
    parameters[2].Value =
    "[FILLED BY USER].[USER ID].&[yshah]";
    //[FILLED BY USER].[USER ID].&[yshah] 
    parameters[3] =
    new reportexe.ParameterValue();
    parameters[3].Label =
    "fromdate";
    parameters[3].Name =
    "fromdate";
    parameters[3].Value =
    "[FIRST DOSE DATE].[Date Key].&[20100101]";
    //[FIRST DOSE DATE].[Date Key].&[20100101] 
    parameters[4] =
    new reportexe.ParameterValue();
    parameters[4].Label =
    "todate";
    parameters[4].Name =
    "todate";
    parameters[4].Value =
    "[FIRST DOSE DATE].[Date Key].&[20100131]";
    // [FIRST DOSE DATE].[Date Key].&[20100131]
    this is my code.
    indu

  • Multi-value parameters and strings with leading zeros

    I have invoice number as a multi-value parameter. Invoice is a string,10 (VBRP.VBELN) .
    Invoice number is my group. If I enter invoices 100 and 200 as parms, then I only get data for invoice #100 (the lowest value entered). But if I enter 100, 0000000100, 200, 0000000200 as parms, then I get data for both invoices. Is there a way to get around having to enter the invoice number in both formats. BTW, if I only enter 0000000100 and 0000000200 then I get no data.
    Selection criteria is (VBRP.VBELN) = ?invoiceno --- parms are defined as allow muliple values and allow discrete values.

    Oops, that's not gonna work with multi-value parameters.  How about:
    if IsNumeric((VBRP.VBELN)) then
      ToText(Val((VBRP.VBELN)), "0") in {?invoiceno}
    else
      (VBRP.VBELN) in {?invoiceno}
    end if
    BTW, the reason why your original formula didn't work was because the "=" should have been "in".  The above is needed only if the (VBRP.VBELN) field might contain leading zeroes.
    HTH,
    Carl

  • Optional Multi-Value Parameters in a URL

    I have 3 summary reports, that each need to hyperlink to 4 detail reports. The summary reports use multi-value string parameters that are set to "optional" (this is crystal 2008). I need to construct URLs to support these optional parameters. The opendoc documentation says to use "no_value" as the param argument, but that doesn't work - I get the string "no_value" in the selection criteria which causes it to fail. Ideally, I'd use either lsMMyParam="NULL" or lsMMyParam="", but neither works. Anyone ever done this?

    hi Bob,
    have you tried doing this...
    &lsMPromptName=[]
    lsM prompt / parameter values have to be passed with square brackets as far as i know.
    jamie

  • Handling multi-value parameters in VS 2005 / Crystal 2008

    In my program I am trying to handle a multi-value parameter using the following code, passing it an array of type string with the values that the user selected, but using the following code returns a 'Missing parameter values' error.
        For Each crParameterFieldDefinition In crParameterFieldDefinitions
            If Not crParameterFieldDefinition.IsLinked And crParameterFieldDefinition.ReportName = "" Then
                crParameterValues = crParameterFieldDefinition.CurrentValues
                crParameterDiscreteValue = New ParameterDiscreteValue
                If crParameterFieldDefinition.EnableAllowMultipleValue Then
                    Dim j As Integer
                    Dim x() As String = Session("FieldDef")
                    For j = 0 To x.GetUpperBound(0) - 1
                        crParameterDiscreteValue.Value = x(j)
                        crParameterFieldDefinition.CurrentValues.Add(crParameterDiscreteValue)
                    Next
                End If
                Session.Remove("FieldDef")
                i = i + 1
            End If
        Next
    I have also tried loading the values into a ParameterValues object and then using ParameterFieldDefinition.ApplyCurrentValues on it, which has been working fine for all of my single value inputs, but using that throws an error about a type mismatch. Any help at all would be appreciated.

    There are a few samples to look at here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    Vbnet_win_paramengine.zip, vbnet_win_multirangeparam.zip and vbnet_win_rangeparameters.zip may be good
    Also, [this|http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23?quicklink=index&overridelayout=true] article has great info.
    This is all assuming you are on SP3 for CR2008:
    https://smpdl.sap-ag.de/~sapidp/012002523100009989492010E/cr2008_sp3_fullbuild.zip
    SP 3 msi     
    https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
    SP 3 msm     
    https://smpdl.sap-ag.de/~sapidp/012002523100007123582010E/cr2008sp3_mm.zip
    Ludek

  • How to include NULL in multi value parameters

    Good Morning,
    I'm posting this question after i tried other links and was not successful. I'm using a report builder to create a report. SSRS2008R2.
    I have a sql to get the data into the data set. Source is ORACLE DB. The query is pulling lastname,firstname,dob,joindt,divname. I created a parameter in the SQL :
    WHERE DIVNAME IN (:divname).
    I created another dataset (select distinct divname from table2) and selected the paramter properties to get the values from the second dataset and selected it to be multivalued. However the user wants to see the NULL's or BLANKS that are in the DIVNAME.
    Can some one please tell me as how i can acheive this?
    When i run the query in the sql plus i get (null) values as well, but when in the second dataset i run the query i just get the DISTINCT divnames and a  "BLANK" field (in SSRS)
    Thanks

    Hi thinkingeye,
    According to your description, you want to include the null values in your multiple values parameter. Right?
    In Reporting Services, we can't allow both null values and multiple values in a parameter. In this scenario, since you have created a dataset for getting distinct divname, we suggest you try "select distinct isnull(divname,-1) from [table]" in this
    dataset so that all the null values will return -1. Also using isnull() function to replace divname in other query. This might be the most effective work around.
    Reference:
    Null and Multi-value parameter possible
    Include Null Value Multi-Value Parameter list
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Multi-Value Parameters to Oracle Stored Procedures via SQL Commands

    Hi,
    When you used stored procedure in CR, you need to declare REF CURSOR, This type of cursor is a dynamic cursor not a static cursor. Hence, you are able to manipulate dataset in this type of cursor.
    Regards,
    Titanium0203

    As far as I know the documentation on CR & stored procedures says that the REF CURSOR has to be a strongly bound one.
    Could you go into a little more detail? Do you mean I should put a multi-valued parameter into a REF CURSOR? Can you post some code snippets here?

  • How to pass multi-value parameters to DDS (data driven subscription)?

    Using RS2005, how should multivalue parameters be stored in a database field so that a data driven subscription can properly read and use them?  I have so far had no luck using syntax of:
    1)  parm1, parm2
    2)  parm1,parm2
    Do single qutoes need to explicitly wrap the values?  Can you please provide an example and a SQL INSERT statement using parm1 and parm2 to demonstrate what to store in the database field? 
    Thanks!!

    I have skimmed through this an have ran into this problem before but not with RS specifically, but with other ASP.NET apps I have built.  Maybe this work around will help.
    In my database I created a table function I call udf_Split List.  It looks like this: (Can't remember where I got this from, but it's not my own.)
    CREATE
    FUNCTION [dbo].[udf_SplitList]
    @List
    varchar(max),
    @SplitOn
    nvarchar(5)
    RETURNS
    @RtnValue table
    Id
    int
    identity(1,1),
    Value
    nvarchar(100)
    AS
    BEGIN
    While
    (Charindex(@SplitOn,
    @List)
    > 0)
    Begin
    Insert
    Into @RtnValue
    (value)
    Select Value
    =
    ltrim(rtrim(Substring(@List,
    1,
    Charindex(@SplitOn,
    @List)
    - 1)))
    Set @List
    =
    Substring(@List,Charindex(@SplitOn,
    @List)
    +
    len(@SplitOn),
    len(@List))
    End
    Insert
    Into @RtnValue
    (Value)
    Select Value
    =
    ltrim(rtrim(@List))
    Return
    END
    Then, in my query I used the following parameter: QueriedField IN(select value from dbo.udf_SplitList(@Parameter,',')  (I used commas to separate the list, but you can use whatever you like (;,|,*, etc.)
    For you @Parameter would be your DDS list parameter.  Hope this helps.  You can enter your list like Item1,Item2,Item3 etc.

  • MULTI VALUE PARAMETERS

    HELLO,
    I need to bring all the information for the List, I am using "Allow MultipleValues", but I cant make it work :(
    I have One dataset for Falculty Name, One with student with balances, amd the last one os Falcuty with classes and stuudent with balances, I am doing a lookup between Student with balances amd Falcuty with classes.
    I am trying to bring all the Falcuty by year and and term, I have the parameter for year and term those are working for single selecion..... HELP

    I use a split string function
    and then in the Where clause of your select you can put
    Where facilityName in (Select item from dbo.fnSplit(@parameter,','))
    The script for fnSplit is
    Create FUNCTION [dbo].[fnSplit]
     @sInputList VARCHAR(8000) -- List of delimited items
    , @sDelimiter VARCHAR(8000) = ',' -- delimiter that separates items
    RETURNS @List TABLE (item VARCHAR(8000))
    BEGIN
     DECLARE @sItem VARCHAR(8000)
     WHILE CHARINDEX(@sDelimiter,@sInputList,0) <> 0
     BEGIN
      SELECT @sItem  = RTRIM(LTRIM(SUBSTRING(@sInputList,1,CHARINDEX(@sDelimiter,@sInputList,0)-1))),
        @sInputList = RTRIM(LTRIM(SUBSTRING(@sInputList,CHARINDEX(@sDelimiter,@sInputList,0)+LEN(@sDelimiter),LEN(@sInputList))))
      IF LEN(@sItem) > 0
       INSERT INTO @List SELECT @sItem
     END
     IF LEN(@sInputList) > 0
      INSERT INTO @List SELECT @sInputList -- Put the last item in
     RETURN
    END

  • How to pass Multi and Singlr value Parameters to DB2 query, which is using in SSRS report for ODBC connection

    Hi Guys,
    I am using DB2 database in SSRS. I have to pass Single Value and Multi Value Parameters. I tried with Select * From DB2Table Where
    Column=@PRM_Name Or Select * From DB2Table Where
    Column=:PRM_Name . It is not working and throwing error. Please help me out.
    Connection Details: ODBC
    Thanks Shiven:)

    Hi SKM,
    So you mean to say that Go to DataSource->Add Dataset-> Query Type-Text-> Under Query:
    click on fx (Expression)-> Write this expression
    For Single Value Parameter:
    ="SELECT customer_name, telephone_number, address1, address2, city from MyTable
    WHERE city = '" + Parameters!City.Value + "'"
    OR
    ="SELECT customer_name, telephone_number, address1, address2, city from MyTable
    WHERE city =  '" & Parameters!City.Value & "'"
    Keep it in mind if Parameter is String then
    It should be in Single quote ''.
     Like
    ="SELECT customer_name, telephone_number, address1, address2, city from MyTable WHERE city
    ='Hyderabad' "
    For Multivalu Parameter:
    ="SELECT EmployeeID, FirstName, LastName, LoginID FROM SHIVEN.AUDIT Where FirstName
    in ('" + REPLACE(JOIN(Parameters!City.Value,","),",","','") + "')"
    NOTE:
    If your Parameter is Single Value Parameter and You want to enter string values with Coma (,)
    separated (Like Hyderabad, Chennai, Delhi).
    In this case, you have to use below expression.
    ="SELECT customer_name, telephone_number, address1, address2, city from MyTable
    WHERE city IN ('" + REPLACE(Parameters!City.Value ,",","','") + "')"
    OR
    ="SELECT customer_name, telephone_number, address1, address2, city from MyTable
    WHERE city IN  ('" & REPLACE(Parameters!City.Value ,",","','") & "')"
    In above expression: Replace will replace all , with ‘,’ and city IN (‘Hyderabad’, ‘Chennai’,
    ‘Delhi’) will not throw any error.
     Note: You have to write expression in one line in Expression editor for dataset
    query
    Thanks It is working fine but it is tough job if query is big.
    Hi S kumar,
    The above approach we use when we have source like DB2, becasue DB2 has some syntactical differences to pass multivalue paramaeter. I tested and it works good, if i am mentioning the query in above format by using Fx button while creating dataset.
    but if we want fetch data from view which exist in DB2 and we need to call db2 view in SSRS and pass multivalue parameter in a way we did above then could you please mention the steps and way to achieve this.
    Thanks in advance!

  • Passing different (multi-) values for parameters to drill-through report, based on clicked subtotal in main report

    In Report Builder 3.0, I have made a main report in which the user can filter the underlying dataset using three parameters (all multi-value). The report shows totals grouped by these three parameters, as well as a grand total. What I want is to click
    on a total, which then opens the drill-through report for the corresponding records. I have achieved this for the grand total; the action in the corresponding text box passes all selected values of the parameters to the drill-through report.
    What I cannot figure out is how to make this work right when clicking on a subtotal. When I use the same expression as for the grand total, the same values for the parameters are passed, instead of the subset that apply to the corresponding text box in the
    main report. I expected this to work, because Report Builder /does/ correctly calculate the SUMs for the different levels, even though the expressions are the same.
    My question is: how do I pass different drill-through (multi-) values for parameters, corresponding to the respective subtotals in the main report?
    (FYI: I am using Microsoft SQL Server 2008 R2 and Report Builder 3.0 .)

    Hello Katherine,
    Thanks once more for your quick reply.
    I was aware of the textbox action "Go to report", and how to pass parameters in general. My question concerned how to determine the scope of the passed multi-value parameters (to the values that apply to the respective group/subtotal). The article you linked
    to is informative, but not a solution to my problem.
    A colleague of mine came up with a pragmatic solution: instead of trying to determine the scope of the parameter values, now I "look to the left in the results table". The two screenshots below should illustrate this. (Screenshots are in Dutch. Specific information
    is pixelated.)
    Unfortunately, I am not able to post images. Once my account is verified, I will edit them in. For now, I hope the text speaks for itself enough.
    [Screenshot: Drill-through parameters - 01: Report Builder tablix with subtotals]
    [Screenshot: Drill-through parameters - 02: Textbox properties (selected in screenshot 01) - Action - Go to report]
    The first screenshot shows the tablix in the Report Builder. The second screenshot shows the properties of the textbox selected in the first.
    Notice that I do not pass parameters for the first two columns, but the actual values. I only pass the parameter (containing /all/ user-selected values) for the third column. In the textbox below the selected one, I pass the actual values for the first column,
    and parameters for the last two. In the textbox above the selected one, I pass the actual values for all three columns.
    The only (cosmetic) flaw this approach has is that in the drill-through report, the list of selected parameters might show values that do not occur in the (corresponding part of the) results, and only for those parameters for which the main report passes (all
    user-selected) parameter values, and not the actual values in the results. The results are correct, though.
    If there is a way to directly determine the scope of multi-value parameters for passing to a drill-through report, I would still like know. But for now, this seems to work.

  • Passing multi value parameter to the Drill through report

    Hi
    I have two reports say Report A and Report B.
    Both reports using same parameters.
    I am Navigating from Report A to Report B using Jump to Report option.
    Now when I pass multiple parameter to the Report B it only displays first parameter results.
    In report B I have parameter multi value select to true.
    I would like to know if its possible or not to pass multi value parameter in drill through report?
    I would appreciate if someone can help me here.
    Regards
    Amit

    Yes you can pass multi value parameters to a drill through report.
    It works similar to multi value parameters for subreports, which is discussed in detail in this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=163803&SiteID=1
    -- Robert

  • 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

Maybe you are looking for

  • How can I select the date in chronologi​cal order on my BB curve?

    This sounds like a crazily basic question but one I can't find the answer to. After merging to a new email system my Curve has jumbled up all emails with no order by date. I can't find ANYWHERE in the instructions or the machine to select viewing ema

  • No backup or copy of datafile 4 found to restore Error ??

    Hi, I have a 2 Virtual machine with Oracle 10g on OEL. Let's say machine 1 is called : OEL-SOURCE MACHINE Let's say machine 1 is called : DR-TARGET MACHINE When i am trying to restore rman backup on 2 machine 'DR', it comes with the message "RMAN-060

  • Adobe photoshop lightroom 4.1 error 1935

    spent all day trying to install even after reading and following instructions on how to fix error 1935 and still no success with lightroom 4.1 heres the full error message "Error 1935.An error occured during the installation of assembly component {B7

  • ERROR WHILE PRODUCT GROUP CREATION

    Dear All, I am trying to creat the product Group but system is giving the following error. Message No.M3749 "Required parameters missing when calling up module". Please give your valuable input to overcome the issue. Thanks & Regards, Vijay Mankar +9

  • How to avoid executables' relinking

    Hello, I'm trying to install Oracle8.0.5 on a libc5 system with the runtime glibc2.0 installed. IN this case I need to avoid relinking of Oracle's executables to avoid problem between the two libraries. Is there a way to specify it during installatio