SELECT c.jobno,a.drwno,c.lastrev,a.revno,b.date AS trdate,a.transno ; FROM issuehistory a ; LEFT JOIN transmittallog b ; ON a.transno = b.transno ; LEFT JOIN drawinglog c ; ON ALLTRIM(a.drwno)==ALLTRIM(c.drwno) ; INTO CURSOR curPrint ; WHERE !DELETED() AND (ALLTRIM(b.iscode)=='A' OR ALLTRIM(b.iscode)=='B') ; ORDER BY c.jobno,sort1,sort2,sort3This returns the following:
Jobno Drwno Lastrev Revno Trdate Transno 6037 E101A C 0 01/17/2003 58995 6037 E101A C 0 01/24/2003 59159 6037 E101A C A 02/10/2003 59352 6037 1 B 0 01/17/2003 58995 6037 1 B A 01/24/2003 59159 ...Is there a way to tag the first instance of a drawing number? Something like below:
Jobno Drwno Lastrev Revno Trdate Transno First 6037 E101A C 0 01/17/2003 58995 .T. 6037 E101A C 0 01/24/2003 59159 .F. 6037 E101A C A 02/10/2003 59352 .F. 6037 1 B 0 01/17/2003 58995 .T. 6037 1 B A 01/24/2003 59159 .F. ...Any help would be greatly appreciated.