JapanFreak
Registered User.
- Local time
- Today, 08:09
- Joined
- Aug 25, 2007
- Messages
- 45
Hi there,
I have a problem with an SQL query, which should combine data out of three different tables (tblTransactions, tblTradedSecurities, tblStopps, tblQuotes) using a combination of Inner-joins and sub-queries. However, I get an error message, which tells me that this is an improper SQL query and that Access rather expects a "Delete, Insert, Select or Update"... what does this exactly mean, what is wrong with my query?
I would be very happy for any hint.
Best regards,
JapanFreak
I have a problem with an SQL query, which should combine data out of three different tables (tblTransactions, tblTradedSecurities, tblStopps, tblQuotes) using a combination of Inner-joins and sub-queries. However, I get an error message, which tells me that this is an improper SQL query and that Access rather expects a "Delete, Insert, Select or Update"... what does this exactly mean, what is wrong with my query?
Code:
SELECT X.Ticker, S.Name, sum(X.Qty) AS TotQty, X.qCl, (SELECT Top 1 [Stop] FROM [tblStopps] WHERE [Date]<=#3/09/2007# AND X.Ticker=tblStopps.Ticker ORDER BY [Date] DESC) AS Stop
FROM [tblTransactions AS T INNER JOIN tblQuotes AS Q ON T.Ticker=Q.qTicker]. AS X INNER JOIN tblTradedSecurities AS S ON X.Ticker=S.Ticker
WHERE X.Date<=#3/9/2007# AND X.qDate=#3/09/07#
GROUP BY X.Ticker, S.Name, X.qCl
HAVING sum(X.Qty)>0
ORDER BY X.Ticker;
I would be very happy for any hint.
Best regards,
JapanFreak