I am using the BOL walkthrough and have come to the Dynamic Query section.
I type in the following into the generic query builder...
="SELECT FirstName, LastName, Title FROM Employee" &
IIf(Parameters!Department.Value = 0,""," WHERE (DepartmentID = " &
Parameters!Department.Value & ")") & " ORDER BY LastName"
But it does not work... Can anyone please assist?If you mean that the fields list is not populated, yes, for query
expressions you'll need to populate the fields list manually. Another
approach is to first type in the static version of the query (select
FirstName, LastName, Title from Employee), run the query, switch to layout
pane, switch back to data pane, and then replace the static version with the
expression-based version you have below. You will then see the fields list.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Bing" <.> wrote in message news:O$HyaHpfEHA.3676@.TK2MSFTNGP12.phx.gbl...
> I am using the BOL walkthrough and have come to the Dynamic Query section.
> I type in the following into the generic query builder...
>
> ="SELECT FirstName, LastName, Title FROM Employee" &
> IIf(Parameters!Department.Value = 0,""," WHERE (DepartmentID = " &
> Parameters!Department.Value & ")") & " ORDER BY LastName"
> But it does not work... Can anyone please assist?
>|||if DepartmentID is numeric try:
="SELECT FirstName, LastName, Title FROM Employee" &
IIf(Parameters!Department.Value = 0,""," WHERE
(DepartmentID = " &
int(Parameters!Department.Value) & ")") & " ORDER BY
LastName"
if DepartmentID is string try:
="SELECT FirstName, LastName, Title FROM Employee" &
IIf(Parameters!Department.Value = 0,""," WHERE
(DepartmentID = '" &
Parameters!Department.Value & "')") & " ORDER BY LastName"
>--Original Message--
>I am using the BOL walkthrough and have come to the
Dynamic Query section.
>I type in the following into the generic query builder...
>
>="SELECT FirstName, LastName, Title FROM Employee" &
>IIf(Parameters!Department.Value = 0,""," WHERE
(DepartmentID = " &
>Parameters!Department.Value & ")") & " ORDER BY LastName"
>But it does not work... Can anyone please assist?
>
>.
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment