Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL and COUNT?
Message
 
To
26/10/2005 12:47:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01062221
Message ID:
01062279
Views:
21
I think it doesn't helps. Chek to see that Russel wants two .T. values in his example.


>Russel,
>
>Think you'll need two queries
>
>
>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_1 NoFilter ;
>WHERE !DELETED() AND (ALLTRIM(b.iscode)=='A' OR ALLTRIM(b.iscode)=='B') ;
>ORDER BY c.jobno,sort1,sort2,sort3
>
>
>select *, ;
>       (recno()=1) as First ;
>    from curPrint_1 ;
>    into cursor curPrint
>
>
>
>>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.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform