R_Avery_17
R_Avery_17

Reputation: 305

How to specify that a value is LESS THAN in a parameter

I have a report that returns various products with the margin we make on each one. I have set up a parameter in the query @Margin. I have set the Parameter data type to integer, but I want the parameter to return all products with a margin of less than 15%.

enter image description here

If I enter the value as <15 then this is not an integer

How do I set the parameter value to <15 (less than 15%)?

EDIT

My mistake was setting up the parameter in the query incorrectly. I had used = @Margin when I should have been using < @Margin. This allowed me to simply change the value from <15 to 15. This gave me my desired result.

Upvotes: 1

Views: 1998

Answers (2)

Rathinamoorthy N
Rathinamoorthy N

Reputation: 46

Add the parameter Margin as integer and provide the value. Then in the data set part you can write the query to filter it less than @Margin value.

Check the image below.

Use parameter value to filter results

Upvotes: 2

SAS
SAS

Reputation: 4045

Use an expression as query. Found here:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0abbeb09-879c-404d-9286-0d1b72b49870/how-to-add-a-report-parameter-to-let-user-choose-less-than-greater-than-or-all-records?forum=sqlreportingservices

A TSQL sample would be:

 ="SELECT * FROM TABLENAME WHERE COLUMN" & Parameters!Operator.Value & Parameters!Hour.Value

Upvotes: 0

Related Questions