Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Syntax for VFP9
Message
From
20/10/2005 11:31:16
 
 
To
20/10/2005 10:43:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01060684
Message ID:
01060746
Views:
12
>Sounds you want something like:
>
>SELECT NVL(a.drwno,'') AS drwno,NVL(a.revno,'') AS rev,;
>DTOC(transmittallog.date) AS date ;
>FROM transmittallog ;
>LEFT JOIN issuehistory a ;
>ON transmittallog.transno = a.transno ;
> WHERE !DELETED() AND (iscode=='A' OR iscode=='B') ;
> AND revno = (select MAX(revno) FROM issuehistory b WHERE a.drwno = b.drwno) ;
>ORDER BY drwno,rev,date ;
>INTO CURSOR curApprovalIssue
>
Cetin


One small addition I'd like to make is the use of CAST() in VFP9 to make sure you get the proper column width in the resulting SQL Cursor:
* assuming you need a C(10) for example:
SELECT CAST(NVL(a.drwno,''),C(10)) AS drwno,
...
In previous versions you can also do NVL(a.drwno,SPACE(10))

Else you could get a one-char wide column when all you wanted is to replace nulls with the proper number of spaces.

Just .02


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform