Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic operator

Status
Not open for further replies.

rose4567

Programmer
Mar 12, 2007
70
0
0
US
I am converting a report from an old legacy system and I am not sure I can duplicate the functionality. I am writing the report in SSRS, but the query driving the report is SQL so I believe this is more a SQL question than a SSRS question.

The legacy reporting system allowed the user to choose their own operator: >, <, >=, <=, =, NOT and I would call the parameter @operator.

I cannot find any way to create a parameter and pass the name of the parameter in my where statement. Has anyone ever written a statement with a dynamic operator? Is that possible in SQL?

I'm looking for a statement that accomplishes something like this:

WHERE trans.trans_amt @operator @amt

so the user can enter their specified operator and amount to generate a queries like:

trans_amt > 0
trans_amt < 15
trans_amt = 30

Ideas anyone??
 
I am not running the SQL in Management Studio. I am running it in Reporting Services. Thank you. I will report in the correct forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top