reportbert
Programmer
I'm trying to figure out how to change the comparison operator in my select statement based on the value of a parameter.
Pseudocode:
if (chooseparam = 'like') then
select column
from table
where column like 'anotherparam%'
else
select column
from table
where column = 'anotherparam'
end if
The problem i keep running into is that if i take this almost-code (corrected for syntax, of course) and put it in the report as a text query, i keep getting an 'invalid sql' error.
Any ideas as to what i'm doing wrong?
Thanks.
Pseudocode:
if (chooseparam = 'like') then
select column
from table
where column like 'anotherparam%'
else
select column
from table
where column = 'anotherparam'
end if
The problem i keep running into is that if i take this almost-code (corrected for syntax, of course) and put it in the report as a text query, i keep getting an 'invalid sql' error.
Any ideas as to what i'm doing wrong?
Thanks.