Subject RE: [IBO] MasterLinks and to get the last records of detail query
Author Jason Wharton
> I use 2 queries, a common master/detail relation.
> I use MasterLinks property and everything works fine.
>
> Now, I need to limit the number of record of the detail table to the
> last 5 records for each master record. I have no idea how to do it.
>
> If I need the first 5 record, then the solution is easy, in the detail
> SQL, I put "select first 5 * from detail" and it works fine, the
> problem is when I need the last 5.
>
> Any comment will be welcome. Thank you in advance

I think you should reverse the ORDER BY to descending instead of ascending
and that will give you the effective last 5 records.

If you setup the OrderingItems and OrderingLinks properties then it can be
as easy as setting the OrderingItemNo property from positive to negative or
clicking on the grid's title cell to change from ascending order to
descending order.

Jason