After you create the two parameters for your

In the next case, consider when your query criteria is an integer. Assume that the report parameter is Year. Suppose that your dataset expression in the Query Designer, you specify a criteria like: >= @MinYear and < = @MaxYear Define a query parameter expression for MaxYear as: =iif(Parameters!Year.Value=0,10000,Parameters!Year.Value) Define a query parameter expression for MinYear as: =iif(Parameters!Year.Value=0,0,Parameters!Year.Value) In this case, the All parameter should be mapped to the value of 0. When All is selected for the parameter value, then the like search criteria expressions become: >= 0 and < = 10000 This will return rows containing any value (other than NULL) in the year field. Using the wildcard method above can be a security risk and could be vulnerable to SQL injection attacks. An alternative way of accomplishing this is to define the following parameter query for the parameter @Year: SELECT All UNION ALL SELECT Year FROM DateDim Then your dataset query expression would be: SELECT YearName, Col2, Col3 FROM FactTable WHERE 1 = CASE WHEN @Year = All THEN 1 WHEN @Year = YearName THEN 1 ELSE 0 END Using this dynamic filter is a very powerful form of using parameters. 370 Part VII: The Part of Tens Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost JSP Web Hosting services

Bookmark the permalink.

Comments are closed.