Dynamic Selection Of Multivalued Parameters

May 4, 2007

Hi All,

I Hope someone can help me out with this problem.. its pretty NB.

I have a pair of multivalued parameters. So, parent and child... the child needs to get its selection based on the selection made by the user on the parent parameter ( the child parameter is hidden).

Fictional values:
Parent Parameter: SelectAll, ALL , 1 , 2
Child Parameter: Home, Work, Play

If user selects "ALL" from the parent parameter I need Home and Play selected.

My idea was this:
=iif(Parameters!Parent.Value(1) = "All","Home,Play") <-- in Available values.

However, the dataset that reads this value does not like the coma delimited string.
This dataset is a cube created dataset, reading the child parameter.

Any help is greatly appreciated.
Kind Regards,
Neil

View 1 Replies


ADVERTISEMENT

MultiValued Parameters.

Mar 27, 2008



Hello All,

Initially in my report, I was not having any MultiValued Parameters. So when I was displaying the reports to the end user, I was displaying the parameter selected by the user in the textbox.


But 2 parameters are now MultiValued. Shall I display to the user the parameters he selects.

If the user selects 30 parameters, then the major part of the report page is occupied by the parameter list that is selected.
I havent worked much on SSRS. So I am not aware of the best practices for SSRS.

I just want a suggesstion from you people. Shall I display the parameters list to the end user ? If yes then how, so that I can reduce the space occupied by the parameter list. Eg.using sub-reports, list, etc.

If no, then why ? because Initially I was having a requirement to display the parameter list because there were no multivalued parameters. But now 2 of them are multivalued parameters.


Thanks & Regards,
Kapadia Shalin P.

View 11 Replies View Related

Multivalued Range Parameters

May 22, 2007

Hi all,

We are using Reporting Services 2005 with Analysis Services 2005 data source.

So far we only had multivalued parameters without any range.

now we are to add a report parameter income group which would have values

Below $75,000 , $75,000 - $120,000, $120,000 - $220000 .....,Above 220000.

Now the user can select multiple range values.. Eg( Below $75,000 , $85,000 - $95,000 , Above $100,000 )

We have to filter the cube with this user selected multiple range values.

Please tell me how to do this in MDX..

Thanks,

Looking Forward your replies



View 1 Replies View Related

Cascading Multivalued Parameters

Apr 1, 2008



Hi,

I have the folowing problem with RS2005.
I have 2 parameters in my report. Firs one is a list of projects which is a single select. The second one allows to select multiple employees.
When I select a project from the first parameter, the list in second parameter gets narrowed to list of employees that are assigned to this project.

The unexpected behaviour:
1. I select "Proj1" from first parameter
2. The second parameter gets narrowed. I select "Select All" employees
3. I generate my report. OK

4. I change the selection in first param to "Proj2"
5. The second parameter gets narrowed, but employees that are common for "Proj1" and "Proj2" are still selected, which is unwanted. ERR

The users of this report gets confused as they generate the report just after point 4. and they think all employees are still selected.

What I want to do is uncheck all employees from second parameter every time the first one is changed. That would cause the user to get a prompt for selecting second parameter.

Is there a way I can do this? Any clue would be nice.

Best Regards.

View 5 Replies View Related

Multivalued Range Parameters

May 22, 2007



Hi all,

We are using Reporting Services 2005 with Analysis Services 2005 data source.

So far we only had multivalued parameters without any range.

now we are to add a report parameter income group which would have values

Below $75,000 , $75,000 - $120,000, $120,000 - $220000 .....,Above 220000.

Now the user can select multiple range values.. Eg( Below $75,000 , $85,000 - $95,000 , Above $100,000 )

We have to filter the cube with this user selected multiple range values.

Please tell me how to do this in MDX..

Thanks,

Looking Forward your replies





View 1 Replies View Related

Hiding Select All For Multivalued Parameters - SSRS 2005

May 7, 2008

Hi All,


Is there any way to disable the "Select All" option which comes by default for Multivalued parameters in the Report Manager?

Thanks in Advance

View 3 Replies View Related

Dynamic Database Selection?

Jun 15, 2007

I'm working on a script to convert data from one software packageto another. Greatly simplified, it looks something likecreate procedure import_widget asbegininsert into our_widget (foo, bar)select baz, quux from their_db.dbo.their_widgetendgoThe problem is that the name of the source database varies fromone system to another, so I want to pass the database name as aparameter. I think I could do the following, but is there abetter way to go about it?create procedure import_widget (@db_name sysname) asbeginexec 'create view their_widget as select * from '+ @db_name + '.dbo.their_widget'insert into our_widget (foo, bar)select baz, quux from their_widgetdrop view their_widgetendgo

View 3 Replies View Related

Dynamic Selection Of DataSource

Feb 6, 2008



Hi,
I need to write a report which will run based on the user's input for Server Group. Meaning, if the user wants the report to be run for one say, UAT group, the report (and therefore the stored procedure) should be executed against UAT server. Or, if the user wants it to be run on the Production machine, the stored procedure should be executed on the Production Server. Assume that both UAT and Production servers are in the same domain to rule out any authentication issue.

I think one way of doing it is to create a linked server on one server which we use to connect via the Report Manager. So, whatever Server Group is selected based on that the SP will be executed on that respective Server Group's Server, since in the query we will have given full names of the tables that we use.

But, I strongly suspect, that having linked servers will not be accepted since it requires that the server owners maintain that. So, I was thinking if there is any other way of achieving this. If anyone knows, please help me with this.

Thanks a lot...

Manoj.

View 3 Replies View Related

Dynamic Member Selection In MDX?

May 28, 2008

I've got a cube in SSAS 2205 with some financial measures that I want to appear conditionally in an MDX query. Here's what I mean...

The cube measures I'm interested in are actual revenue, forecast revenue and budget revenue. The dimension I'm reporting across is the [Time].[month] member. The report I'm trying to create with this query has each month across the top. But the headers show actual revenue if the current reporting month is on or before the month in question. For future months, we show the forcast revenue if there is any. For any other future revenue, we show the budget measures. So a sample report for April would have columns like...



Code SnippetJanuary February March April May June July August September
Actual Actual Actual Actual Forecast Forecast Forecast Budget Budget

I need to conditionally bring back the right measure and have the measure name (e.g., column header) indicate if it's an actual, forecast or budget value.

Thanks.



View 2 Replies View Related

Dynamic Selection Of Column

Nov 19, 2007



Hi,
I have to choose a particular column from a table whenever a condition met. That means i have to use the column in the select query whenever the condition met otherwise i have to create a dummy column with the same column name.
I tried to use the following sample query.
Eg:
Create table temp
(test_id int,
test varchar(100))


Declare @var varchar(100)
Set @Var='Hi'
Select
case when @Var='HI' then "None" else Test_new End as Test
from Temp

But it throw error as "Invalid column 'Test_new' "

As per my situation the Test_new column will be available in temp table whenever the condition is not met.So when @var<>'HI' i have to get the details of the test_new column otherwise i have to create a dummy column with the same name.

View 5 Replies View Related

[SQLDatasource]Dynamic Selection Of Column

Mar 29, 2006

Hey, I have a search form with a selectbox. This selectbox contains the columnnames.I want when I put a text in a textbox and select a value in the selectbox and click submit that it search database.The Columnnames I put in a session.
If you see I have put in the querystring as columnname @sescolumn which I have initialised as asp:sessionparameter.But it gives no results. When I put @sescolumn between [] like normal columnnames are it doesn't work also.
Can someon put my on the right path?

 
<asp:SqlDataSource ID="Database_ecars" runat="server" ConnectionString="<%$ ConnectionStrings:connectionstring %>"
SelectCommand="SELECT [AutoID], [Merk], [Kleur], [Type], [Autotype], [prijs], [Zitplaatsen], [Afbeelding1], [Afbeelding2], [Afbeelding3], [Afbeelding4] FROM [Auto] where @sescolumn like @seskeyword and [AutoID] not in (select [AutoID] from [verhuring] where [StartVerhuur] >= @sesdatefrom and [Eindeverhuur] <= @sesdatetill)" >
<SelectParameters>
<asp:SessionParameter Name="sesdatefrom" SessionField="datefrom" Type="Decimal" />
<asp:SessionParameter Name="sesdatetill" SessionField="datetill" Type="Decimal" />
<asp:SessionParameter Name="seskeyword" SessionField="keyword" Type="string" />
<asp:SessionParameter Name="sescolumn" SessionField="columnname" Type="string" />
</SelectParameters>
</asp:SqlDataSource> 

View 3 Replies View Related

Dynamic Selection Of Flat File

Oct 6, 2006

I am writing a package where the user uploads a flat file to a web folder. I need to automate this package to run everytime it sees a new file.

How can I implement this?

Can I make a call to a package or a sql server job to run from .net 2.0?

Do I need to use a service broker to look for a new file and run the package or a stored proc....I am looking for an async process where user doesnt have to wait for the package to run as it involves data validation of flat file and its huge...

Please help!!

View 2 Replies View Related

Automating Record Selection Parameters

Feb 27, 2006

Hi,I need some advise on how to automate record selection on a storedproc. Here is my situation. I have a stored proc that I used onCrystal reports with two parameters - Acctcode and Subacct. When auser enters ' *' on these parameter, it means to report on allaccounts otherwise, report only on specific account.Here is my select statement with line numbers:Create proc rb_SubledgerRpt@Acctcode varchar(4), @SubAcct varchar(3)As3 Select AcctCode, SubAcct4 From GLDetails5 Where SubAcct <> ' '6 and AcctCode = @Acctcode -- for specific acctcode7 and SubAcct = @SubAcct -- for specific subacct8 Go-- If a user wants to see all Acctcode, and all Subacct, how do Idisable lines 6 and 7?Thank you in advance for your help.Edgar

View 6 Replies View Related

Parameters - Selection From A Long List

Jul 20, 2007

Hello



I want to have a report query parameter which has many thousands of possible values (i.e. Customer Names). I need to provide the ability to allow a user to search for the customer they want and then have that customer's detail appear in the parameter.



Ideally I would like something like the ability to have a "Find" button next to the parameter that would kick off a "Find" report and then pass the value selected back to the original parameter.



The parameter in question is one of a numvber (6) on the actual report so have discounted the option of creating a "Find Customer" report as step 1 and then passing the selection forward to the actual report (Step 2) i.e. drill through.



Any thoughts/suggestions would be much appreciated as I know I will have many of these scenarios in the coming months as I will be using numerous parameters with large selection lists.



Thanks in advance

Eliot

View 2 Replies View Related

Restricting The Selection Of Multivalue Parameters...

Apr 25, 2007

hi all,



Is there any way to restrict the user from selecting the parameters. For example: I have a list of 100 values in a multi-value parameter. I want to to restrict the user to select at the most N number of values.

If possible, process only the N number of values will also do.



Thnx in advance...

View 3 Replies View Related

Dynamic Column Selection In Stored Procedure

Feb 10, 2005

Hey Guys,

Here is the issue I'm having. I am writing a stored procedure that takes a couple of parameters. Each one is the value within a specific column in one table (i.e., @part = 'o-ring' or @sub_assembly = 'hydraulic ram'). Needless to say, the columns form a hierarchy. What I am trying to achieve is to allow the user to specify one of the parameters and get a count for all records where the specified value is in the corresponding column. So, if the user puts in the parameter @part = 'o-ring', I want it to know that the where clause for the select statement should look for o-ring in the part column and not the sub_assembly column. Here is what I am trying to do, which isn't working.

DECLARE @querycolumn varchar(20),
@queryvalue varchar(35)

SET @querycolumn = ''
SET @queryvalue = ''

IF(@sub_assembly = NULL)
BEGIN
IF(@part = NULL)
BEGIN
PRINT 'This is an error. You must have at least a part'
END
ELSE
BEGIN
SET @querycolumn = 'Part'
SET @queryvalue = @part
END
END
ELSE
BEGIN
SET @querycolumn = 'SubAssembly'
SET @queryvalue = @sub_assembly
END

SELECT SubAssembly, Part, COUNT(RecordID)
FROM Table
WHERE @querycolumn = @queryvalue
GROUP BY SubAssembly, Part
ORDER BY SubAssembly, Part

The problem is that I'm getting an error when I try to use @querycolumn to supply the column name to the WHERE clause. Any ideas or suggestions?

View 14 Replies View Related

SSRS Dynamic Chart Type Selection?

Apr 16, 2008

Does anyone know if there is a way to dynamically set the chart type (i.e. pie, line, column, etc.) for your report in SSRS? I want the customer to be able to chose which type of chart they'd like to see.

I've looked all over the Internet and can't find anything.

Any help would be appreciated.
Alan

Clarification:
I guess I should clarify a little. I am using an ASP.NET 2.0 page written in C# and using a ReportViewer control.

More Clarification:
The ReportViewer displays an rdlc.

View 10 Replies View Related

Filtering Parameters Based On A Selection Of Another Parameter

Dec 28, 2007



Hi,

Im trying to create a drop down parameter whereby if i select a certain field, a different dropdown will be filtered off only the relevant selections, is this possible.

View 7 Replies View Related

SSRS 2005 - Email Report On Execution To Dynamic List With Dynamic Parameters = No Schedule

Nov 23, 2007

Hi,
I have a need to display on screen AND email a pdf report to email addresses specified at run time, executing the report with a parameter specified by the user. I have looked into data driven subscriptions, but it seems this is based on scheduling. Unfortunately for the majority of the project I will only have access to SQL 2005 Standard Edition (Production system is Enterprise), so I cannot investigate thoroughly.

So, is this possible using data driven subscriptions? Scenario is:

1. User enters parameter used for query, as well as email addresses.
2. Report is generated and displayed on screen.
3. Report is emailed to addresses specified by user.

Any tips on how to get this working?

Thanks

Mark Smith

View 3 Replies View Related

Reporting Services :: Parameters Drop Down Selection Not Showing In The Report?

Aug 31, 2015

I created a re port using the Report builder. The report runs fine. I want to create a parameter on the report. I created a new dataset with the query "select distinct dept from table" . Then i created a new parameter to get the values from the second dataset. After running the reports when i selected 2 departemnts, its still showing all the records.

View 3 Replies View Related

Two Parameters Question? Second Parameter Should Get Data Based On First Parameter Selection.

Jan 8, 2007

I have two parameters both are related to each other.

second parameter should get filled based on the selection of the first one which is project.

the first paramater is project, once the project is selected it should bring the all the contracts related to that project.

Please is it possible...



Thank you very much for all the helpful info.

View 5 Replies View Related

Dynamic Parameters

May 22, 2008

I have a report that i want to beable to do some dynamic paramaters on it. I have a start and end date of when they want to run the report but i also have a mulivalue list box for users filtering for users. I want to add a supervisor filter on form also. But I have a problem.

I want to allow the users to select a supervisor and filter for all employees under that, or allow them to select a set of users and allow them to filter for that also. Also i would like when they select no supervisor or user it just filters for the dates and picks all up all the users.

I thought i could do something like in access like this Like UserName & "*"
but it doesnt work.

Here is my dataset code i am using currently:
SELECT U.Name, A.row_date, A.split, A.SumOfti_stafftime, A.AHT, A.AvgACW, A.AvgACD, A.AvailTime, A.SplitSkill_Incalls, A.SplitSkill_Outcalls, A.SumOfacdtime,
A.SumOfti_othertime, A.SumOfacwtime, A.SumOfti_auxtime0, A.SumOfti_auxtime1, A.SumOfti_auxtime2, A.SumOfti_auxtime3, A.SumOfti_auxtime4,
A.SumOfti_auxtime5, A.SumOfti_auxtime6, A.SumOfti_auxtime7, A.SumOfti_auxtime8, A.SumOfti_auxtime9, U.Sup
FROM tblAvayaDaily AS A RIGHT OUTER JOIN
tblUsers AS U ON A.logid = U.[Avaya ID]
WHERE (A.split = 1651) AND (U.Name IN (@UserName)) AND (A.row_date BETWEEN @rDateStart AND @rDateEnd) OR
(A.split = 1655) AND (U.Name IN (@UserName)) AND (A.row_date BETWEEN @rDateStart AND @rDateEnd) OR
(A.split = 1653) AND (U.Name IN (@UserName)) AND (A.row_date BETWEEN @rDateStart AND @rDateEnd)

View 9 Replies View Related

Dynamic SQL And Parameters

Feb 15, 2008

I am currently working on a project that involves creating dynamic insert and update statements for dynamically created tables. The tables I am creating the statements for could have up to 1000 columns.

Obviously building the entire insert/update SQL string dynamically in VB.Net and sending it to the Sql server leaves the system vulnerable to injection attack or error caused by single quotes in strings.

I am using the Patterns and Practices Data Application block for my data access.

What I am considering is creating the dynamic sql as a statement with the columns names and values in as parameters (@XXXXX) and then looping through my list of columns and values and adding them as by AddInParameters on the DbCommand.

- Can it handle such large amount of parameters at all?
- What kind of structure does ADO.net send to the SQL server? i.e. Will using so many parameters mean that the data communicated to the SQL server from the webserver by the parameter method would be much larger than the substituted dynamic sql string?
- How does ADO.NET/SQL Server 2005 perform with such large amounts of parameters on a DBCommand?


Any advice as to whether this is a viable way to proceed would be much appreciated.

Oh yeah... I am using VB.NET in VIsual Studio 2005 with a SQL Server 2005 DB.

Thanks

Mark

View 1 Replies View Related

What Is Faster: Dynamic Sql WITH Or WITHOUT Parameters?

Mar 19, 2004

Here is he issue.

* We have a DAL that generates all SQL dynamically out of a nobject model. Standard very powerfull O/R mapper.
* In the DAL, for CRUD operations, we generate the statements dynamically. As an example, let's take INSERT.
* The insert is generated ONCE, with parameters, and cached. For every reuse, the parameters are replaced (in value), and the whole thing commited.

I see hte following negative: I can not easily batch multiple inserts. Parameters have to be unique per batch. So, if I want to batch two inserts, I need two sets of parameters.

Alternative:

Instead of generating the SQL with parameters, we generate the SQL as a string ready to be inserted for / with a String.Format, and then I encode the parameters and make one SQL String out of this. Now, please - don't say "sql injection", we are not that stupid, the layer handles this already, properly encoding all dangerous values.

With this approach, the SQL statement would be a string and not use any parameter. As a result, I could batch them up as much as I want (ok, up to a certain string size). I need to keep parameters around anyway (for blobs etc.), but most objects do not have blobs, and the SQL is prettty small. This small SQL could be batched significantly (100 statements per batch, propably mode) and be submitted to the database. As a result, the round trips to the databae would go down.

Now, my question is - which of the two approaches is more advisable, from a performance point of view? Again, stuff like SQL injection and ease of handling are totally irrelevant - the SQL never leaves the DAL and is generated in there, and we will go through a lot of complexitiy for higher performance.

Normally I would say batching should be better. SQL Server can auto-parameterize the statements (reusing the query plan), and / but the network round trips are the larger issue here.

Any comments on this?

View 3 Replies View Related

MDX PeriodsToDate() W/dynamic Parameters

Nov 15, 2005

Hi All,

I'm trying to write a formula (actually, four) which will be used in Panorama NovaView to allow a user to see Revenue (on rows) by Previous Month (Current Year), Previous Month (Previous Year), Current YTD (ending at month in question), Previous YTD (ending at month in question) (on columns -- not necessarily in that order).

Basically, when run anytime during November 2005, the output would look like:

2004 Total | Oct 2004 | 2005 Total | Oct 2005
$ 100,000 | 15,000 | 120,000 | 17,500

The Dimension I'm working with is [Calendar Year], with levels: (All), [Calendar Year], [Calendar Month], [Calendar Week].

I've been focusing on the formula for the first column, since it is the most complex (I think). Here's the jist of what I am trying to do:

SELECT Measures.Revenue ON ROWS,
<<Last Year>>.January : <<Last Year>>.<<LastMonth>> ON COLUMNS
FROM SalesCube

I believe some combination of PeriodsToDate(), LastPeriod() and/or <<Current Year>>.PrevMember & <<Current Month>>.PrevMember is what I need, but I just can't get the syntax right.

Any help would be appreciated.

Thanks,
Ian Field
SD Union-Trib

View 1 Replies View Related

SQL 2012 :: Contains Use On Dynamic Parameters

Sep 16, 2015

how to use Contains function on sql parameters?If Sql parameter has space then its not working else working.

e.g
If @searchParam='serachtext' then its working but if its @searchParam='serach text' then not working

View 2 Replies View Related

Dynamic Optional Parameters

Feb 13, 2008

Good day,

I have an issue on constructing dynamic WHERE conditions that use OPTIONAL parameters.

SP_SOMETHING (
1) @DateFrom datetime,
@DateTo datetime,
2) @Param1 char(8),
3) @Param2 char(3),
4) @Param3 tinyint
)

I would like to use a where clause that can make use of any combination of the 4 parameters (the two dates should be together)

1 2 3 4
/ x x x
x / x x
x x / x where x = not supplied
/ = supplied a value

(and so the list continues)
Can anybody assist me or give me insights on how to go about this complicated WHERE construct without listing all the probable combinations of the supplied parameters in series of IF statements.

thank you

View 3 Replies View Related

Dynamic Capabilities With Parameters

Jan 22, 2007

Hello all,

I have a winform application, where in we get the parameters from the reporting service and we display them in a panel for user's to input their criteria. So far everything worked good, but now we have a requirement wherein dynamic functionality is needed.

For Example:

Based on a selection of a combobox value, we want the other control to be enabled or disabled. Also we want default value of a control to be calculated based on another control's value like .. if user enters value "1" in textbox1 then texbox 2 should have default value of "6". (Textbox1 + 5).........and mix and match of such capabilities.

The Question is........IS IT POSSIBLE??? and if yes...HOW!!!

View 6 Replies View Related

Dynamic Updating Of Parameters.

Sep 5, 2007

Hi I am using sql server reporting services 2000 and in a report I have more than 20 parameters of data type Boolean. I want another parameter drop down which have "select all" and "clear all" options. When user select €œselect all€? option from the parameter list all 20 parameters value should be false.

I will be very thankful.

Regards,
Faisal Saleem

View 5 Replies View Related

ADOMD.NET : Dynamic Parameters

Mar 27, 2007

Logically speaking, the two cases below should behave the same. However case 2's output is wrong. Perhaps someone knows what's wrong in case 2.



Case 1:
-------------
AdomdCommand cmd = new AdomdCommand();
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "SELECT Cluster(), PredictCaseLikelihood()" +
" FROM [Data Validation]" +
" NATURAL PREDICTION JOIN" +
" (SELECT " +
" (SELECT @var0 as [var] " +
" UNION SELECT @var1 as [var] " +
" UNION SELECT @var2 as [var]) AS [vartable]) AS t";





Case 2
-------------
AdomdCommand cmd = new AdomdCommand();
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "SELECT Cluster(), PredictCaseLikelihood()" +
" FROM [Data Validation]" +
" NATURAL PREDICTION JOIN" +
" (SELECT " +
" (SELECT @var0 as [var] ";
for(int i=1; i<3; i++)
{
cmd.CommandText = cmd.CommandText +
"UNION SELECT @var" + i.ToString() + " as [var] ";
}
cmd.CommandText = cmd.CommandText + ") AS [vartable]) AS t";



Mary

View 4 Replies View Related

Dynamic Order By W/ Additional Parameters

Jan 16, 2006

I have a stored procedure that uses a dynamic order by statement.  This statement works okay until I try to select ticket's by userEmail which is passed in to my stored procedure as a parameter.  Here is the code that works for my dynamic sort order:
CREATE PROCEDURE [dbo].[SelectAllTickets]
@SortOrder varchar(250)
AS
SET NOCOUNT ON
Exec('SELECT a.TicketID, a.TicketDate, a.TicketName, a.TicketDescription, a.statusID, a.resolutionID, a.userID,
b.typeID, b.typeName,
c.userID, c.UserFirstName,
f.statusID, f.statusName
FROM Tickets a
LEFT OUTER JOIN Type b ON b.typeID = a.typeID
LEFT OUTER JOIN Users c ON c.userID = a.userID
LEFT OUTER JOIN Status f ON f.statusID = a.statusID
ORDER BY ' + @SortOrder)
I modied this procedure to create one in which I select tickets based on the userEmail as a criteria as well.. this one fails due to Incorrect syntax near the keyword 'BY'
CREATE PROCEDURE [dbo].[SelectTicketByUser]@SortOrder varchar(250),@userEmail varchar(50)
AS   SET NOCOUNT ON   Exec('SELECT a.TicketID, a.TicketDate, a.TicketName, a.TicketDescription, a.statusID, a.resolutionID, a.userID,  b.typeID, b.typeName,  c.userID, c.UserFirstName, c.userEmail,  f.statusID, f.statusName      FROM Tickets a  LEFT OUTER JOIN Type b ON b.typeID = a.typeID LEFT OUTER JOIN Users c ON c.userID = a.userID LEFT OUTER JOIN Status f ON f.statusID = a.statusID WHERE a.statusID <> 40 AND c.userEmail = ' + @userEmail + 'ORDER BY ' + @SortOrder)
Any ideas on what syntax I should be using? Thanks!

View 3 Replies View Related

Dynamic Query With Multi-value Parameters

Jun 1, 2008

Is anybody here knowing how to create a dynamic query based on a multi-value parameter?

e.g. there is a multi-value report parameter called names. For a static query, the where clause of a select statement likes the following

select * from students where name=@names

For the dynamic one, I tried something like the below, but it did not work.

="select * from students where name=(" & Join(Parameters!names ,',') & ")"

Any suggestion would be great appreciated.



Thanks,
KY

View 2 Replies View Related

Dynamic Crosstab - How To Pass Parameters

Nov 28, 2013

I am trying to use one sql store procedure but don't know how to pass the parameters. I am posting here my store procedure:-

create procedure dynamic_pivot
(
@select varchar(2000),
@PivotCol varchar(100),
@Summaries varchar(100)
) as
declare @pivot varchar(max), @sql varchar(max)

[Code] ....

My table looks like below:

emp_id, time_code, date, time_charged
RB, VAC, 20130222, 8
RB, HOL, 20131128, 8
RB, VAC, 20130311, 8

My output should be:

emp id VAC HOL
RB 16 8

View 5 Replies View Related







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