Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL and COUNT?
Message
From
26/10/2005 11:03:25
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL and COUNT?
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01062221
Message ID:
01062221
Views:
50
I have the following SQL statement:
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,sort3
This 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.

Thanks in advance.
Next
Reply
Map
View

Click here to load this message in the networking platform