Leenaa
23rd July 2003, 13:29
hi all,
what is the command to get the last record of database



thanx in advance

Francesco
23rd July 2003, 16:37
db.last()

NPRao
23rd July 2003, 19:59
Francesco,

We shouldnt use the db-statements unless its unavoidable.

Please refer to the thread -

retriving next reccord (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=8707&highlight=guide)

I would prefer to use a select statement with the primary index and with a desc and as set with 1 rows. Then you get the last row info.

Here is a sample code-

select ttaad320.*
from ttaad320
where ttaad320.user = :logname$
and ttaad320._compnr = 000
order by ttaad320._index1 desc
as set with 1 rows
selectdo
fpath = ttaad320.tmpf
endselect