I have a SSRS report that taps data from an Oracle DB.
I like to compare two parameters and swap values (if need) before the query uses them.
Can't get it work. Please give me any hint.
Scenario:
parameter :Year1 and :Year2; :Year1 value must be smaller than :Year2
if :Year1 > :Year2 then swap values
run the query
DECLARE
Y1 INT := :YEAR1;
Y2 INT := :YEAR2;
BEGIN
IF (Y1 > Y2) THEN
SELECT Y1, Y2 INTO Y2, Y1 FROM dual;
END IF;
SELECT AA, BB, CC
FROM MYTABLE
WHERE (MYYEAR BETWEEN Y1 AND Y2)
END;
duke