Hi,
I am facing problem in reporting services using parameter field.I am
passing values to parameter field empids like '10,12'.I want the data of
employee 10 and 12.while creating the parameter how can i mention.In t-sql
empid IN @.eID is it correct,how can i mention in parameter field.
Thanks in advance
Malli.There are several ways you may do this...If your user can make a properly
formatted comma delimited list your SQL might look like this
="Select * from employee where employeeid in (" +
Parameters!EmployeeID.Value + "))"
you could also make a table valued function which parses the parameter and
returns a table which contains one row for each employee id. YOu then join
that to the employees table
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Malli" <Malli@.discussions.microsoft.com> wrote in message
news:E7538F08-2BA3-4590-8FE6-B84C3EB96BC3@.microsoft.com...
> Hi,
> I am facing problem in reporting services using parameter field.I am
> passing values to parameter field empids like '10,12'.I want the data of
> employee 10 and 12.while creating the parameter how can i mention.In t-sql
> empid IN @.eID is it correct,how can i mention in parameter field.
>
> Thanks in advance
> Malli.|||Hi Wayne,
i might have a similar issue and what you propose is not working for me. I
don't know if it was the same issue for Malli but at least it is the same
topic.
I open a report in Design mode and i am on the Data pane.
I want to have a recordset with one field being a parameter where the user
can enter comma separated values (i will inform the user in the parameter
prompt).
Now, i can make the test of the query in the Data pane.
- when i'm typing IN (@.Status) and in the pop-up the value 1 then it works
fine
- when i'm typing IN (@.Status) and in the pop-up the value 1,5 then it
doesn't work
- when i'm typing IN (1;5), it is transformed to IN (N'1','5') and it works
(thank you Microsoft for that new syntax !)
- when i'm typing IN (@.Status) and in the pop-up the value 1;5 then it
doesn't work
So, how to write the query for the report in the Data pane ?
What should the user enter as value in its text box ?
Thanks a lot to solve this mysterious behaviour.....Dominique
************************************************************
"Wayne Snyder" wrote:
> There are several ways you may do this...If your user can make a properly
> formatted comma delimited list your SQL might look like this
> ="Select * from employee where employeeid in (" +
> Parameters!EmployeeID.Value + "))"
> you could also make a table valued function which parses the parameter and
> returns a table which contains one row for each employee id. YOu then join
> that to the employees table
>
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Malli" <Malli@.discussions.microsoft.com> wrote in message
> news:E7538F08-2BA3-4590-8FE6-B84C3EB96BC3@.microsoft.com...
> > Hi,
> > I am facing problem in reporting services using parameter field.I am
> > passing values to parameter field empids like '10,12'.I want the data of
> > employee 10 and 12.while creating the parameter how can i mention.In t-sql
> > empid IN @.eID is it correct,how can i mention in parameter field.
> >
> >
> > Thanks in advance
> >
> > Malli.
>
>
No comments:
Post a Comment