Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 vx VFP8 SQL
Message
From
13/05/2004 14:37:17
 
 
To
13/05/2004 13:50:54
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00903642
Message ID:
00903750
Views:
16
Tamar,

Here's where it really got me. I've been trying to fix problems in a former programmer's code. Here's his original code.

SELECT a.FR, b.Date - 1,;
SUM(IIF(ISNULL(a.Total_Pcs),000000,a.Total_Pcs)) AS Qty, ;
SUM(a.Total_PCs*(g.StdHrs)) AS Hours,;
SUM(a.Total_Pcs * c.Cost) AS Cost,;
e.Group, ;
g.StdHrs AS StdHrs,;
c.Cost AS Price,;
h.Finish;
FROM Yields h,TemStdHrs g, FRData c,fr d, CellGrp e, Audit2 a;
LEFT JOIN Log85 b;
ON a.Audit_No == b.Audit_No;
WHERE b.Date >= gdbegdate+1;
AND a.Ct_Pointed = .T.;
AND !EXIST(SELECT FR FROM CoatNoUse k;
WHERE k.FR = a.FR);
AND c.FR = a.FR;
AND g.FR = a.FR;
AND d.FR = a.FR;
AND h.FR = a.FR;
AND e.TeamNumber = d.TeamNumber;
AND !EMPTY(a.FR);
AND !EMPTY(b.Date);
GROUP BY a.FR, b.Date;
ORDER BY e.Group,a.FR, b.Date;
INTO ARRAY laMTDDock

I first changed the ! EXIST portion to a.FR # k.FR on a LEFT JOIN between the tables and it worked just fine. When I moved it to VFP8, I had to use an ISNULL() in the field conditions. ISNULL() in VFP6 returns an empty table. I finally went back to a su-select query and got my results. (I also cleaned it up with aliases that meant something and used SYS(3054) to find slow spots. Indexes (indices) were something that he couldn't comprehend as making a difference in queries! Anyway, the CoatNoUse table only had six records but the whole query was dramatically impacted by checking the table.

Thanks again,

Tim
Duty is ours, the results are God's - John Quincy Adams
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform