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??
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??