Hi Paul,
Try this formula:
SELECT
PKLIB.TESTPK1.LINTOT01, distinct(PKLIB.ICDET76PK.ITTRN#)
FROM
PKLIB.TESTPK1,PKLIB.ICDET76PK
WHERE
PKLIB.TESTPK1.IDINV# = PKLIB.ICDET76PK.ITTRN#
AND PKLIB.TESTPK1.IDPRT# =
PKLIB.ICDET76PK.ITPRT#
I think u r not mention PKLIB.ICDET76PK and distinct function is used to remove duplicates from the result..
--Dhana