The last record means nothing in database/table/set theory. The database can return the records in any order unless you provide an ORDER BY clause. Most database systems however are consistent.
If you supply an ORDER BY column then you can use the TOP specifier to get the record you need. For example if P.PKey are ascending values then:
Code:
SELECT TOP 1 NXTACT
FROM INVPOCS_POI_NXTACT N, INVPOCS_POI P
WHERE N.FKEY = P.PKEY
AND P.REQUSTNNUM = '1951225'
AND P.ENTITYCODE = 'HAR'
ORDER BY P.PKEY DESC
will order them in reverse order and then return just the top row.
--
Joe (
Microsoft MVP - XML)