Quantcast
Channel: Baanboard.com
Viewing all articles
Browse latest Browse all 4216

order by no function

$
0
0
Hi,

I have customize a new table and new session. How can I display the data on session sort by section and length.
Eg:
-------------------------------------------------------------
| Section | Length | Qty |
-------------------------------------------------------------
| section B | 340 | 2 |
| section B | 103 | 18 |
| section A | 500 | 3 |
| section A | 205 | 10 |
| section A | 40 | 1 |
-------------------------------------------------------------
I wrote a code as below,
Code:

|****************** declaration section *********************
declaration:
        table  ttccus024 | Short Bar List

|******************** program section *********************
before.display.object:
        get.record.field.readonly()

|********************** function **************************
Functions:

function get.record.field.readonly()
{
        select tccus024.*
        from tccus024
        where tccus024.sect = :tccus024.sect and tccus024.lgth = :tccus024.lgth
        order by tccus024.sect desc, tccus024.lgth desc
        selectdo
        endselect
}

when run the session is display as below:

-------------------------------------------------------------
| Section | Length | Qty |
-------------------------------------------------------------
| section A | 40 | 1 |
| section A | 205 | 10 |
| section A | 500 | 3 |
| section B | 103 | 18 |
| section B | 340 | 2 |
-------------------------------------------------------------

Please advise.

Viewing all articles
Browse latest Browse all 4216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>