Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Received / Outgoing Product
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01210081
Message ID:
01211409
Views:
11
I had problems with the below code. For some reason, the NVL function may have given me incorrect resulting quantities. I am tearing this apart and will put it back together today. I think you are on the right track; it's just that I've never written code like the below; at least one part of it isn't working right yet.
SELECT ;
            cs.CustNo, ;
            cs.Customer, ;
            NVL(QtyIn, 000000), ;
            NVL(QtyOut, 000000), ;
            NVL(QtyIn, 000000)-NVL(QtyOut, 000000) As QtyDiff ;
         FROM Customer cs ;
         LEFT JOIN (SELECT cust, SUM(StandsIn) FROM StandsIn AS QtyIn GROUP BY 1) si ON si.cust = cs.custno ;
         LEFT JOIN (SELECT cust, SUM(SerialCnt) FROM Stands_Out AS QtyOut GROUP BY 1) so ON so.cust = cs.custno ;
         ORDER BY ;
            cs.Customer
Previous
Reply
Map
View

Click here to load this message in the networking platform