Order by clause [message #900613] |
Tue, 07 August 2012 19:02  |
Utkarsh Shinde Messages: 4 Registered: August 2012 |
Junior Member |
|
|
Hi,
I have preparing a report but i have issue..The query is following
SELECT A.MAN_NAME,
B.MAN_MODEL_NUMBER,
B.MAN_MODEL_DESC,
C.CUST_MODEL_NUMBER,
C.CUST_MODEL_DESC,
B.MODEL_ID,
c.min_qty,
c.max_qty
FROM RAC_MODEL B,
RAC_MANUFACTURER A,
RAC_CUST_MODEL C
WHERE A.MAN_CODE=B.MAN_CODE
AND b.MODEL_ID=C.MODEL_ID
AND c.username = :P_USER
and (c.min_qty IS NOT NULL OR c.max_qty IS NOT NULL)
group by A.MAN_NAME,
B.MAN_MODEL_NUMBER,
B.MAN_MODEL_DESC,
C.CUST_MODEL_NUMBER,
C.CUST_MODEL_DESC,
B.MODEL_ID,
c.min_qty,
c.max_qty order by :p_order_by
In place of p_order_by i have to use A.MAN_NAME and C.CUST_MODEL_NUMBER
but only one at time.Both not use at one time.ie.I have to select values between
A.MAN_NAME and C.CUST_MODEL_NAME.
How do to that.
I used list box in Parameter but it is not working.
[Updated on: Tue, 07 August 2012 19:05] Report message to a moderator
|
|
|
Re: Order by clause [message #900816 is a reply to message #900613] |
Wed, 08 August 2012 15:19  |
|
How do you want to select how its ordered? Through a report parameter?
You could always cut off the last order by statement and in the
beforeOpen script of the dataset you could check the value of a
parameter and modify the query like:
if( params["OrderBy"].value == "CUST" ){
this.queryText = this.queryText + " order by C.CUST_MODEL_NUMBER"
}else{
this.queryText = this.queryText + " order by A.MAN_NAME"
}
Jason
On 8/7/2012 3:02 PM, Utkarsh Shinde wrote:
> Hi,
> I have preparing a report but i have issue..The query is following
>
> SELECT A.MAN_NAME,
> B.MAN_MODEL_NUMBER,
> B.MAN_MODEL_DESC,
> C.CUST_MODEL_NUMBER,
> C.CUST_MODEL_DESC,
> B.MODEL_ID,
> c.min_qty,
> c.max_qty
> FROM RAC_MODEL B,
> RAC_MANUFACTURER A,
> RAC_CUST_MODEL C
> WHERE A.MAN_CODE=B.MAN_CODE
> AND b.MODEL_ID=C.MODEL_ID
> AND c.username = :P_USER
> and (c.min_qty IS NOT NULL OR c.max_qty IS NOT NULL)
> group by A.MAN_NAME,
> B.MAN_MODEL_NUMBER,
> B.MAN_MODEL_DESC,
> C.CUST_MODEL_NUMBER,
> C.CUST_MODEL_DESC,
> B.MODEL_ID,
> c.min_qty,
> c.max_qty order by :p_order_by
> In place of p_order_by i have to use A.MAN_NAME and C.CUST_MODEL_NUMBER
> but only one at time.Both not use at one time.ie.I have to select values
> between A.MAN_NAME and C.CUST_MODEL_NAME.
> How to that.
> I used list box in Parameter but it is not working.
>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02137 seconds