Re: reports 2.5 sorting question

From: Martin Cookson <m_cookson_at_hotmail.com>
Date: Sun, 28 Mar 1999 00:38:57 -0000
Message-ID: <7djtpc$di7$1_at_plug.news.pipex.net>


Use a lexical parameter in the order by clause:

ORDER BY &param

Remember to give the parameter an Initial Value, otherwise, you will get an error when you close the query window.

Martin Cookson

techwritery2k_at_my-dejanews.com wrote in message <7dgjtl$6dg$1_at_nnrp1.dejanews.com>...
>I need help in my SQL statement ORDER BY clause: User requires 4 ways to
sort
>in one report..my parameter form has a listbox with 4 values..I need to
pass
>the selected value and append to the ORDER BY..My query is :
>
>SELECT
> SKY_ORDER_ALERT.SKA_CREATE_DATE,
> SKY_ORDER_ALERT.SKA_GPC_ID,
> SKY_ORDER_ALERT.SKA_ORDER_NO,
> TO_DATE(SKY_ORD_INTF_LINE_PKG_CONT.IOLC_USER5,'YYMMDD'),
> SKY_ORD_INTF_LINE_PKG_CONT.IOLC_DETAIL_NO,
> SKY_ORD_INTF_LINE_PKG_CONT.IOLC_SI_ITEM_ID,
> SKY_MESSAGES.MSG_TEXT
>
> FROM SKY_ORDER_ALERT,
> SKY_ORD_INTF_LINE_PKG_CONT,
> SKY_MESSAGES
>WHERE (SKY_ORDER_ALERT.SKA_ACTIVE_FLAG='A' AND
> SKY_ORDER_ALERT.SKA_GPC_ID = 'OC')
>
>AND (SKY_ORD_INTF_LINE_PKG_CONT.IOLC_ID = SKY_ORDER_ALERT.SKA_IOLC_ID)
>
>AND (SKY_ORDER_ALERT.SKA_MSG_NO =SKY_MESSAGES.MSG_NO) AND
>(TO_DATE(SKY_ORD_INTF_LINE_PKG_CONT.IOLC_USER5,'YYMMDD') >SYSDATE-1) ORDER
BY
>-- either a) TO_DATE(SKY_ORD_INTF_LINE_PKG_CONT.IOLC_USER5,'YYMMDD') ASC,
b)
>SKY_ORDER_ALERT.SKA_ORDER_NO, c) SKY_ORD_INTF_LINE_PKG_CONT.IOLC_SI_ITEM_ID
>ASC d) SKY_ORD_INTF_LINE_PKG_CONT.IOLC_SI_ITEM_ID
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Sun Mar 28 1999 - 01:38:57 CET

Original text of this message