Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Order by clause
Order by clause [message #900613] Tue, 07 August 2012 19:02 Go to next message
Utkarsh Shinde is currently offline Utkarsh ShindeFriend
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 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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.
>
>
>
>
>
Previous Topic:BIRT PDF Viewer
Next Topic:Setting the value of the value of the page variable to the value of the computed column in dataset
Goto Forum:
  


Current Time: Thu Apr 25 14:02:19 GMT 2024

Powered by FUDForum. Page generated in 0.02795 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top