Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Select all Paramters

$
0
0

I have the code to create a paramter drop down of a list of departments from a report.  At the moment if the department is unknown or 'sales' e.g. picking up one value only it works fine.  I need it to also allow me to pick up all department values in one go. If I modify the paramter to allow muliple values.  Then the report fails as it states

  • Must
    declare the scalar variable "@Department".

Do I need to hardcode the departments in somewhere on the paramter options on the report maybe ?

(


@Department

VARCHAR(60)

)


AS

BEGIN


IF(@DepartmentISNULL)


SELECT


 

ISNULL(Department,'Unknown')AS Department,


  DisplayName

,


  WorkNumber

,


  HomePhone

,


  Mobile

,


  Position

FROM dbo.GetPeopleAndPhoneNumbers

ELSE


SELECT*


FROM

(


SELECT


 

ISNULL(Department,'Unknown')AS Department,


  DisplayName

,


  WorkNumber

,


  HomePhone

,


  Mobile

,


  Position

FROM dbo.GetPeopleAndPhoneNumbers

) [D]

WHERE Department= @Department


END

 


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>