Passing Parameter in report [message #88310] |
Thu, 27 June 2002 02:09 |
Godwin
Messages: 37 Registered: January 2002
|
Member |
|
|
Hi there,
I want to pass a parameter to a field in the where clause of the query as follows:
select distinct paqnote,paatil||' '||paasur||' '||paafnme,
pagname,(paaappr/12),paqdte,paqedte,round(months_between(paqedte,paqdte)/12)
from paapr1 a,pagpos b,paqsal c
where a.paanum=c.paqnum
and a.paapost=b.pagcode
and c.paqsrindcode in :p_2
and a.paanum = :p_1
order by paqdate asc
In this case the parameter p_2 is a char variable that should accept values like ('17','18').
The problem is that nothing is selected when the report is run but rather if i destroy the parameter p_2 and place that actual value it works i.e:
select distinct paqnote,paatil||' '||paasur||' '||paafnme,
pagname,(paaappr/12),paqdte,paqedte,round(months_between(paqedte,paqdte)/12)
from paapr1 a,pagpos b,paqsal c
where a.paanum=c.paqnum
and a.paapost=b.pagcode
and c.paqsrindcode in ('17','18')
and a.paanum = :p_1
order by paqdate asc
2. also i want the sorting order to be by the date field paqdate in ascending order but it is not sorting it in that order.
|
|
|
Re: Passing Parameter in report [message #88312 is a reply to message #88310] |
Thu, 27 June 2002 07:19 |
gary herman
Messages: 5 Registered: June 2002
|
Junior Member |
|
|
You can't use multiple char literals in a single parmeter. Why don't you try splitting up the parameter into several parms like this...
p_2 = '17'
p_3 = '18'
As for the date sort, try putting it into a different format.
|
|
|