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:
01211502
Views:
10
At the risk of looking foolish (again),I'm not sure about the syntax error, but I would have expected a Column not found error.
LEFT JOIN ;
>			(;
>			SELECT Cust, SUM(StandsIn) As QtyIn ;
>				FROM StandsIn ;
>				GROUP BY ;
>					si.cust, ;
>					cs.customer ;
>			) ;
>			si ON si.cust = cs.custno ;
because both the si and cs alias from the group by clause are established outside the parens.



>I tried the following and I keep getting SYNTAX ERROR. Is there anything about the below SQL Statement that would cause that? I do not readily see any syntax errors. Would removing the NVL functions cause a syntax error?
>
>
>	SELECT ;
>			cs.custno, ;
>			cs.customer, ;
>			QtyIn As 000000, ;
>			QtyOut As 000000, ;
>			QtyIn - QtyOut As QtyDiff ;
>		FROM ;
>			customer cs ;
>		LEFT JOIN ;
>			(;
>			SELECT Cust, SUM(StandsIn) As QtyIn ;
>				FROM StandsIn ;
>				GROUP BY ;
>					si.cust, ;
>					cs.customer ;
>			) ;
>			si ON si.cust = cs.custno ;
>		LEFT JOIN ;
>			(;
>			SELECT Cust, SUM(SerialCnt) As QtyOut ;
>				FROM Stands_Out ;
>				GROUP BY ;
>					so.cust, ;
>					cs.customer ;
>			) ;
>			so ON so.cust = cs.custno ;
>		ORDER BY cs.Customer
>
Previous
Reply
Map
View

Click here to load this message in the networking platform