>SELECT type,desc,* FROM wipdata!logfile tl WHERE Date = (SELECT MAX(date) FROM logfile WHERE Jobno = tl.Jobno AND Type = tl.Type) into cursor tmptrans >>
>SELECT *,CNAME FROM wipdata!logfile,wipdata!operators where OPERATOR=NEMPNO into cursor tmptrans >>
SELECT LG.*, OP.cName from LogFile LG INNER JOIN Operators OP on LG.Operators = OP.NEmpno ; INNER JOIN (select Max(Date) as LastDate, JobNo, Type from LogFile ; GROUY BY JobNo, Type) X ON LG.JobNo = X.JobNo and LG.Type = X.Type and LG.Date = X.LastDateI prefer derived table approach to correlated subquery - you may want to test both methods to compare performance.