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

SQL Query Data "Last Records"

$
0
0
Hi Guys,

I want to select the last row in my query.

I've already tried the as set with 1 rows but it only displays 1 data only regarding if I have may types

Sample:

I have an Sales Order Type of A, B and C.

The OUPUT when I use the Order by desc is this:

C003
C002
C001
B002
B001
A004
A003
A002
A001

And then when I added as set with 1 rows it will display like this:

C003

What I need to display is like this:

A004
B002
C003

Any suggestions?

I tried the Select Max() but I'm getting an error, here is the sample query that have error:

Code:

select max(tdsls400.orno)
from tdsls400
where tdsls400.odat >= tdsls400.odat.f and
            tdsls400.odat <= tdsls400.odat.t
group by tdsls400.orno

PS: I'm using the Query Data and I'm not creating any session.

Thanks in advance,
amator

Viewing all articles
Browse latest Browse all 4216

Trending Articles