Re: Reports 2.5 Question
Date: 1997/06/23
Message-ID: <33AEEBF7.C84_at_johnbryce.co.il>#1/1
The are two ways to do this.
- You may use sql function SIGN inside DECODE For example in sqlplus:
select decode(sign(&A-&B),1,'A>B',-1,'B>A','A=B') from dual;
2.You may use substitute future of Report,
and dinamicaly change all your where clause.
Steps:
2.1 Create additoinal user_parameter my_where (CHAR)
(Put initial value to this parameter) 2.2 Write something like this in After_Parameter_Form trigger :
if :parameter_from_list = 'Greater' Then
:my_where='where number > '||:someotheruserparameter1; elsif :parameter_from_list = 'Less' Then
:my_where='where number < '||:someotheruserparameter1
else
:my_where='where number between ('||:someotheruserparameter1
|| 'and '||:someotheruserparameter2 ||')';
end if;
2.3 In select statement :
Select number, word, fubar
From mytable
&my_where;
- Original Message ------------------- I am trying to set up a user parameter which works in the following manner:
Provided with a list (Greater, Less, Between)
Then, I want to do this:
Select number, word, fubar
From mytable
where (number > :someotheruserparameter1
number < :someotheruserparameter1 number between :someotheruserparameter1 and:someotheruserparameter2)
I've got the parameters set up correctly, but am having troubles setting up the select statement correctly. I tried
Select number, word, fubar
From mytable
where decode(:choice, 'Greater', number > :someotheruserparameter....
etc, but it isn't working.
- Slava