>>SELECT dept,MAX(printtime) as pt ; >> FROM prn_status ; >> WHERE wono = ww ; >> GROUP BY dept ; >> INTO CURSOR curTemp >> >>SELECT p1.* ; >> FROM prn_status p1 ; >> JOIN curTemp ct ON p1.dept = ct.dept AND p1.printtime = ct.pt ; >> WHERE p1.wono = ww; >> INTO CURSOR crsData>>
>select p1.* from prn_Status p1 >where PrintTime = (select max(PrintTime) from prn_Status p where p.dept = p1.dept)Thanks Naomi. I appreciate the help.