How To Pass Multiple Values To A Parameter While Cascading

Oct 9, 2006

Hi,

I am using RS2005. i have a requirement in which i need to pass more than 1 value to a parameter. this parameter is used in a dataset for filtering.

Eg: if i have a parameter as @years, i want to assign values 2005, 2006 to it and use it in the dataset to filter like select.... where year in (@years).

How can i achieve this?

Thanks

Vivek S

View 13 Replies


ADVERTISEMENT

Transact SQL :: How To Pass Multiple Values Into A Single Parameter

Jun 1, 2015

Below is the query for my procedure 

ALTER PROC [dbo].[sp_GetInvitationStatusTest]
(
@invited_by NVARCHAR (50)
)
AS
BEGIN
-- SELECT * FROM dbo.Merck_Acronym_Invitations WHERE invited_by=@invited_by
select distinct t1.invited_isid as 'ISID', t1.invited_name as 'NAME',t1.invitation_status as 'STATUS',

[Code] ....

If you look at the where clause i have invited by , i get the desired output if i just provide 1 name in the execution such as exec [dbo].[sp_GetInvitationStatusTest] 'marfilj' But my requirement is to make the procedure work with more than one input variable such as exec [dbo].[sp_GetInvitationStatusTest] 'marfilj','sujith' now i should get the output for 2 people but if i run this i receive the following error Procedure or function sp_GetInvitationStatusTest has too many arguments specified.

how to make my procedure work with more than 1 input variable?

View 4 Replies View Related

Integration Services :: Pass Multiple Parameter Values To SSIS Package In 2012 Through Stored Procedure?

Jul 9, 2015

we can  assign one parameter value for each excecution of  [SSISDB].[catalog].[set_object_parameter_value] by calling this catalog procedure..

Example: If I have 5 parameters in SSIS package ,to assign a value to those 5 parameters at run time should I call this [SSISDB].[catalog].[set_object_parameter_value] procedure 5 times ? or is there a way we can pass all the 5 parameters at 1 time .

1. Wondering if there is a way to pass multiple parameters in a single execution (for instance to pass XML string values ??)
2.What are the options to pass multiple parameter values to ssis package through stored procedure.?

View 4 Replies View Related

How Do I Pass A Group Of Values In A Parameter? Like Where Id In (@Value)

Mar 30, 2006

I want to do something like this
SELECT     LocationID, Description, ActiveFROM         dbo.CapLocationWHERE     (Active = 1)
AND (LocationID NOT IN (2)) AND
(LocationID NOT IN (@LocationID) OR @LocationID IS NULL)ORDER BY Description
For the life of my I can not figure out how to pass a group of values like 1,2,3.
Any help would be greatly appreciated,
Bryan

View 3 Replies View Related

How To Pass Parameter Values To Stored Procedure In Rs

Mar 16, 2007

this is the error  ...

An error has occured during report processing.

Query execution failed for dataset 'dataset name'
Procedure 'procedure name ' expects parameter '@StartDate', which was not supplied

View 3 Replies View Related

T-SQL (SS2K8) :: How To Pass Array Of Values As Parameter Of Function

Mar 4, 2014

I am trying to find out a way to pass an array of pbaseid's to a function.I have a function defind something like this

Fport(@portfoliobaseid, @reportingcurr, @rowno,@todate)
(
returning a table
)

trying to execute it like this but its giving error related to subquery must return single value

select * from Fport((select pbaseid from dbo.pbaseid),'us',1,'12/31/2013')

I think i need to find a way to pass this pbaseid one by one but i dont know how to do this ...

View 1 Replies View Related

Pass Parameter Values To Stored Procedure In Dataset

Jul 10, 2007

I have a stored procedure "spDetailsByDay" which takes parameters @StartDateTime as datetime, @Day as int, @Hour as int, @Value1 as varchar(20), @value2 as varchar(20)



My report Parameters are StartDateTime as DateTime, Day as integer, Hour as integer, Value1 as string, Value2 as string, ReportType as string

In the dataset, I typed

=IIF(Parameters!ReportType.Value="Day", "EXEC spDetailsByDay " & Parameters!StartDateTime.Value & "," & Parameters!Day.Value & "," & Parameters!Hour.Value & "," & Parameters!Value1.Value & "," & Parameters!Value2.Value", "EXEC spDetailsByMonth")



I am getting syntax errors. Can anyone help me how to pass parameters to stored procedure in dataset.



Thanks.

View 4 Replies View Related

How To Pass Multiple Value From A Single Parameter In Sql Report

Jan 25, 2008



In my form i have a list box and i need to display paticular records of all employees I selected.So please tell me how to pass multiple values from a single parameter.

currently i am able to pass single value through a parameter using following code




osqlreport.reportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/reportserver");

osqlreport.reportViewer1.ServerReport.ReportPath = "/employee/5_0emplyeedata";



List<Microsoft.Reporting.WinForms.ReportParameter> paramList = new List<Microsoft.Reporting.WinForms.ReportParameter>();



string stritem;





stritem = Convert.ToString(this.lstSelectedData.Items[0]);

paramList.Add(new Microsoft.Reporting.WinForms.ReportParameter("paraempno", stritem, false));



osqlreport.reportViewer1.ServerReport.SetParameters(paramList);

osqlreport.reportViewer1.RefreshReport();

osqlreport.Show();


what changes do i need to do to make it work.(lstSelectedData is my list box)

View 3 Replies View Related

Pass Multi-values In A Single Parameter For Stored Procedure

Apr 16, 2013

I got issue when passing multiple values to a single parameter. Here is my stored procedure as following:

CREATE PROCEDURE [dbo].[School]
@Grade AS varchar(50),
@Class As varchar(50)
AS
BEGIN
SELECT Name, Grade, Class
FROM School
WHERE Grade = (IsNull(@Grade, Grade)) AND Class IN (IsNull(@Class, Class ))
END

In the front end, I got multiple values for Subject parameters such as Math, English, Reading, etc... in a specified class. How do I can modify my above stored procedure to receive multiple values for a single parameter.

View 14 Replies View Related

How To Pass Multiple Values To An IN Clause Through Stored Procedure

Jun 11, 2004

I created a stored procedure like the following in the hope that I can pass mulitple company_id to the select statement:


CREATE PROC sp_test @in_company_code nvarchar(1024)
AS

select company_code, name, description
from member_company
where company_code in (@in_company_code)


However, I tried the following :

exec sp_test 'abc', 'rrd', 'bbc'

Procedure or function sp_test has too many arguments specified.

and SQLServer doesn't like it.

Did I specify this stored procedure correct?
If so, how can I can pass multiple values to the stored procedure then to the sql statement?
If not, is it possible to specify a stored procedure like this?

Thanks!

View 2 Replies View Related

How To Pass Multiple Parameter In Crystal Report To Draw Bar Chart In Asp.net

May 28, 2007

i want to create bar chart dynamically. how to pass the x axis values and y axis values in crystal report in runtime.

View 1 Replies View Related

Reporting Services :: Pass Multiple Values From Field To Sub Report

Dec 3, 2015

I would like to know how does subreport accept multi value, and how should i modify my expression so that the sub report will display correctly.

My main report will pass dynamic number of account number to sub report, it depends on how many account number a person has. I have my sub report parameter Data Type set as "Allow multiple values" and the visibility is "Visible".

Currently, I am using the following expression to try to pass multi value from main report to sub report. I had tested the result of that expression. It is showing the following result when there are 3 account numbers to pass to sub report.

1534896
1563498
1593548

With that expression, when only one account no is pass from main report to sub report, the sub report will display the result. But when more than one account numbers are passing over, the sub report display nothing, it is blank.

--expression
=Join(LookupSet(Fields!PersonNo.Value,Fields!PersonNo.Value,Fields!AccountNo.Value,
"accounts"),""
+ VBCRLF)

*Note: I cannot put the account number into a multivalue parameter in the main report and pass from that parameter to sub report. I know this will workd BUT I had tried that by setting the default value in the multivalue parameter to the dataset that consists of the account number. That involves 100 thousand plus plus account numbers and it will for sure over the limit of 8000 characters.

View 2 Replies View Related

Adding Values To A Parameter That Can Take Multiple Values

Jun 6, 2007

If I have a Select statement like this in my C# code:
Select * From foods Where foodgroup In (@foodgroup)
And I want @foodgroup to have these values ... "meat", "dairy", fruit", what is the correct way to add the parameter?
I tried
meat, dairy, fruit
'meat', 'dairy', 'fruit'
but neither worked. Is this possible?

View 2 Replies View Related

Default Parameter Value Is No Longer Part Of Cascading Parameter In SSRS 2005?

Jan 30, 2007

Hi,

I need "conditional" cascading parameters: In Report Manager when one changes parameter 1, parameter 2 get changed based on parameter 1. Optionally, one can also enter values to parameter 2 directly.

I was able to achieve this in SSRS 2000 (SP2) with the following setups. SSRS 2005 and SP1 no longer works - Parameter 2 always shows its default value regardless whether one select a value in Parameter 1 or not.

Parameter 1
available values: from query
default values: non query (specify a value "<None>")
Parameter 2
available values: Non query (no value specified)
default values: from query (based on Parameter 1)

It seems to me that the default value in SSRS 2000 is considered as cascading parameter. But it is no longer the case in SSRS 2005.

Is this a SSRS 2005 bug? is there any other work arounds or suggestions?

Thanks.

Kong

View 6 Replies View Related

Default Values Does Not Include All The Values (Cascading Parameters)

Mar 18, 2007

A have a multi-valued parameter (B) which is dependent on a single-valued parameter (A) on my report. When a value is selected in A, I want all matching values in B to be selected by default and the "Select All" option checked. To do this I have set the Default Values section in B to point to the same dataset as the "Available Values" section. Both A and B have default values so the report runs automatically.

One of the values in parameter A (say Value1) yields more values in parameter B than the other (say Value2).

If I run the report the first time with Value1 selected as the default for parameter A, all values in B are checked correctly. If I run the report with  Value2 selected the first time and then change the selected value to Value2 and run my report, all values in B are displayed but only the values that were previously checked (when Value1 was selected), are now checked, leaving the "Select All" unchecked.

What am I doing wrong? Why are all the values in B not checked? The dataset is the same in "Available Values" section and "Default Values" section.

 

View 8 Replies View Related

Multiple Values Of A Parameter

Feb 8, 2008

I have some 5 parameters which I've specified as multi-valued and my report uses a stored procedure. When I select all values in my dropdown (parameters) within my reports nothing shows up. How can I pass multiple values of a parameter into my stored procedure such that it works?

View 4 Replies View Related

Parameter Label With Multiple Values

Oct 22, 2007

Hi,

I have a parameter "country" that currently has something like 50 labels (each with a different value) for different countries. I want to be able to design this so that I can select US, Canada and World. This requires me to put multiple values under the "World" label.

Is this doable in reporting services?

Thanks in advance,
Steven

View 3 Replies View Related

SQL Report With Parameter For Multiple Values

Apr 20, 2007

I need to somehow set up a third parameter which allows me to control the tag quantity type either by ALL - % , IS NULL, or IS NOT NULL.



I tried TAG_QUANTITY LIKE :Tags but this would only work if I had the % option select and not the IS NULL or IS NOT NULL



Any thoughts on how to format the select statement?





SELECT ORGANIZATION_ID, TAG_ID, PHYSICAL_INVENTORY_ID, TAG_NUMBER, CREATION_DATE, VOID_FLAG, TAG_QUANTITY, TAG_UOM, SUBINVENTORY,
LOCATOR_ID, COUNTED_BY_EMPLOYEE_ID
FROM INV.MTL_PHYSICAL_INVENTORY_TAGS
WHERE (ORGANIZATION_ID = ite) AND (PHYSICAL_INVENTORY_ID = :InventoryID) AND (VOID_FLAG = 2) AND TAG_QUANTITY IS NULL
ORDER BY TAG_NUMBER

View 1 Replies View Related

Parameter Setup: One Label Multiple Values --- Can This Be Done?

Mar 12, 2008



I reviewed many threads and looked through many pages in my book, I cannot find my answer.

I have a report in need of carrying multiple values per parameter label. Here is the report parameter and how it is used;

Our IS system considers A-Active, L-On Leave, P-Paid Leave to be "Active"
Our IS system considers T-Terminated, D-Deceased to be "Termed"

Instead of having to have the user click upon three options (A, L, P), I would like to group these and have the Label appear as "Active", while the two options for "Termed" (D, T), would appear as the second parameter option.

Does anyone know how I would get this correctly setup in the Report Parameters... module?

I have tried

Label|Value
Active|A,L,P
Termed|D,T

And

Label|Value
Active|(A,L,P)
Termed|(D,T)

Thank you,


Mark

View 3 Replies View Related

Analysis :: Default Multiple Values For A Parameter

Nov 5, 2015

I am trying to select some values as default for a parameter, I add my data set,add my parameter then I  select the values in the default pane, when I run the report I get :

'the default value expression for the query parameter contains an error[BC30451] name is not declared.

When I look at the expression of the default parameter (in the report data pane under the specify values) it appears like

=new Object() {[Sty].[ST].&[1], [Sty].[ST]..&[15]}
with a red scrible under the () 

View 9 Replies View Related

How To Pass Pass The Parameter In SQL Command In SSIS Package

Jul 31, 2006

Hi

   We already used Oracle Datasatage Server the following Query statement for Source and Lookup.here there is parameter maping in the SQl Statement . How can achive in SSIS the Folowing Querystatment?

 

Query 1: (source View Query)
SELECT
V_RDP_GOLD_PRICE.GDR_PRODUCT_ID, V_RDP_GOLD_PRICE.ASSET_TYPE, V_RDP_GOLD_PRICE.PREFERENCE_SEQ, V_RDP_GOLD_PRICE.RDP_PRICE_SOURCE, TO_CHAR(V_RDP_GOLD_PRICE.PRICE_DATE_TIME,'YYYY-MM-DD HH24:MI:SS'), TO_CHAR(V_RDP_GOLD_PRICE.REPORT_DATE,'YYYY-MM-DD HH24:MI:SS'), V_RDP_GOLD_PRICE.SOURCE_SYSTEM_ID
FROM
V_RDP_GOLD_PRICE V_RDP_GOLD_PRICE
WHERE
REPORT_DATE = (select max(report_date) from V_RDP_GOLD_PRICE where source_system_id = 'RM' )



 

Query 2: (look up )

 


SELECT
GDR_PRODUCT_ID,
TO_CHAR(MAX(PRICE_DATE_TIME),'YYYY-MM-DD HH24:MI:SS') ,
TO_CHAR(REPORT_DATE,'YYYY-MM-DD HH24:MI:SS')
FROM
V_RDP_GOLD_PRICE
where
GDR_PRODUCT_ID = :1 and
report_date = TO_DATE(:2,'YYYY-MM-DD HH24:MI:SS')  AND
PRICE_DATE_TIME BETWEEN TO_DATE(:2,'YYYY-MM-DD HH24:MI:SS') - 7) AND TO_DATE(:2,'YYYY-MM-DD HH24:MI:SS')
GROUP BY GDR_PRODUCT_ID, TO_CHAR(REPORT_DATE,'YYYY-MM-DD HH24:MI:SS')



 

please anyone give the sample control flow  and how to pass the parameter?

 

Thanks & regards

Jeyakumar.M

 

View 1 Replies View Related

T-SQL (SS2K8) :: Insert Multiple Values Based On Parameter

Jul 22, 2014

I need to write SP where user select SUN to MON check boxes. If user select Class A with sun,mon and wed check boxes then i need to insert data as below

CLASS Days
A sun
A Mon
A wed

View 6 Replies View Related

SQL Server 2014 :: Linking Parameter To Multiple Values

Feb 17, 2015

Attempting to build a report were you can place a specific code in the parameter field and it will return all row values based on that particular code. I have a similar report that works great, but the specific code is just in 1 column, the one I'm trying to create has the potential to have that code in up to 20 different spots. I have the report built, but the issue I'm facing is linking the parameter. Is there a way to link 1 parameter to multiple column options?

Here's an example:

Docflo Distribution Group Queue Status Pend1 Pend 2 Pend 3 Pend 4 Pend 5
ABC ABC1 Catch All NEW 123 126 125 621 129
ABC ABC1 Various PENDED 621 123 872 542 630

Right now if I were to link the parameter to the Pend1 field, I would get every line I wanted that had Pend "123", but it would not include any of the lines where Pend "123" was in Pend 2, Pend 3, Pend 4, so on.

How would I link the parameter to more than 1 column so it would return all rows with a specific code no matter which Pend column it was in?

View 9 Replies View Related

Transact SQL :: How To Make Procedure Work For Multiple Values In Parameter

Jun 7, 2015

Below is the stored procedure i have it works fine if i have 1 value passed to @invited_by but i want to modify but i want this code to be working for multiple inputs .Lets say if i do

exec [dbo].[sp_GetInvitationStatusTest] 'Test1 . I get the desired output but i want this procedure to work for
exec [dbo].[sp_GetInvitationStatusTest] 'Test1,Test2'.
USE [merck_acronyms]
GO

[code]....

View 2 Replies View Related

Passing Multiple String Values Separted By A Comma As One Parameter

Oct 16, 2007



Hello,



I have a stored procedure that accepts one parameter called @SemesterParam. I can pass one string value such as €˜Fall2007€™ but what if I have multiple values separated by a comma such as 'Fall2007','Fall2006','Fall2005'. I still would like to include those multiple values in the @SemesterParam parameter. I would be curious to hear from some more experienced developers how to deal with this since I am sure someone had to that before.



Thanks a lot for any feedback!

View 6 Replies View Related

SQL Server 2008 :: Table Valued Function Where Parameter Has Multiple Values

Jan 29, 2015

Is it possible to pass multiple values to a TVF, such as using an IN clause?

View 6 Replies View Related

Reporting Services :: Selecting Data Using One Parameter With Multiple Text Values

Oct 9, 2015

I am using SSRS 2008 R2 Report Builder 3.0 (10.50.4276.0) . I have simple set of data which has a persons Title and Name e.g. Mr Smith, Miss Jones, Doctor Foster

The report has a parameter where the user can select which records to show based on the matching titles (Mr, Miss, Doctor)

The Query for the report uses Title in (@Title) where @Title is the only parameter which can take multiple values. The report works correctly for any 1 value selected, but as soon as 2 or more values are ticked in the drop down, it fails.

I believe the parameter value is being passed into the query with a comma separating the values e.g. Mr,Miss which causes the IN statement to give an error, as the statement would be where Title IN ('Mr,Miss') which does not match any of the data values.

The parameter value passed needs to be 'Mr','Miss' for the IN statement to work. What statement do I have to put in the report query to get it to select any of the data rows where the title matches any 1 of the selected values?

View 5 Replies View Related

Cascading Parameter With ODBC

Sep 24, 2007

Hi Friends,

I have 2 parameter One is Office (Listbox) another Account(list box) , where Account list box filling is dependent on the Office selection.

In published report when I select the office from list box the page got refreshed but it not updating the account list, the account list box looks diabled?

I have define the two parameter and for the second parameter here is the query

="SELECT ACCOUNT_ID, ACCOUNT_NUMBER FROM MLGDB2.A_ACCOUNT " &
"where OFFICE_ID =" & Parameters!paramOffice.Value &
"ORDER BY ACCOUNT_ID "

To access parameter i need to use Parameters!paramOffice.Value with ODBC driver instead of @param.

Can any one help me.

Thanks

Novin

View 4 Replies View Related

Cascading Parameter Not Working

Sep 20, 2007

Hi Friends,

I have 2 parameter One is Office (Listbox) another Account(list box) , where Account list box filling is dependent on the Office selection.

In published report when I select the office from list box the page got refreshed but it not updating the account list, the account list box looks diabled?

I have define the two parameter and for the second parameter here is the query

="SELECT ACCOUNT_ID, ACCOUNT_NUMBER FROM MLGDB2.A_ACCOUNT " &
"where OFFICE_ID =" & Parameters!paramOffice.Value &
"ORDER BY ACCOUNT_ID "

Can any one help me.

Thanks

Novin

View 4 Replies View Related

Reporting Services :: How To Filter MDX Query Using SSRS Report Parameter With Multiple Values

Oct 14, 2009

I am creating a SSRS report using a SSAS cube as it data source.  The user would like to select multiple values from a reporting parameter that is then used as a filter on the MDX statement.  I am bale to have the report work successfully when only one value is selected but not when multiple values are selected; the report uses only the first value from the reporting parameter when it contains multiple values.  How do I filter an MDX query using a SSRS report parameter with multiple values?

View 3 Replies View Related

Cascading Parameter Resets When Report Is Run

Feb 18, 2008



I am having a problem with Cascading Parameters in a RS2005 SP2 report.
In the report the user selects the part # (param 1) based on the part number selected the
serial # list (param 2) is populated. This all works fine.

The problem is that when the user clicks on the View report button the report is generated and the part # stays the same but the serial # parameter is "reset". On the development box it gets reset to the last serial # on the list. When we deploy out to our production environment it gets reset to the first serial # in the list.

Is there a way to stop the serial # (param 2) from being reset and to have it stay to what the user selected.


Thanks.

View 3 Replies View Related

Reporting Services :: Cascading Multi-Value Parameter

Sep 30, 2015

So this is my first time posting on MSDN but I am running into an issue I don't know how to circumvent. This issue isn't causing my report not to run but it makes it very confusing for end users.  I am building a report for a user and he was cascading parameters. The parameters are Department (the Parent), Site (the Child) and Vehicle Class (the grandchild).

Here is my issue: If I select 2 Departments named Dept1 and Dept2, the Site parameter populates. If Dept1 and Dept2 have sites named the same, example fleet, Fleet shows up in the site parameter twice. 

Then the Vehicle Class parameter populates. Now if at those sites they have the same vehicle class, lets say 1/2 ton pickup, 1/2 ton pickup is in the vehicle class parameter twice. 

All three of these parameters are populated by a query and all of the queries are using SELECT DISTINCT. I know I could manually input values for the parameters but there are to many departments and sites and they all vary to much depending on the department. 

Is there a way to to only have distinct values populate the parameter even if the parents have the same child?

View 3 Replies View Related

Cascading Parameter Alwaycome Back To Default Value

Feb 9, 2007

Hi all,

I encounter a cascading parameter problem that confuses me badly.



I have a Web App, say App1, and view the server report, say Report1, through Report viewer. I pass a parameter (P1)value from App1 to Report1. at the report side, I create a dataset, say DS1, against the P1's value. Then I create second parameter P2 whose value comes from dataset DS1, and I set its default value as DV1 (it could be Null, or querying from DS1 or a constant). The report1 comes agains the value of @P2.


The problem is here, when the report is run, @P2 can show correct value list in its dropdown (comes from dataset DS1), but after I select the values and click 'view report', the of value of @P2come back to the default one, DV1, and the report comes out against the DV1 (not what I selected).


Any idea?

Thanks

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved