If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
SQL Syntax Error
Lynn Trapp asked me to post the actual SQL code so that it can be checked for
error. The error is "Syntax error in FROM clause." SELECT Stock.Item, Sum(Stock.Quantity), Sum(Sales.[Item Bought]) FROM Stock JOIN ON Stock.Item = Sales.Item Bought GROUP BY Stock.Item |
#2
|
|||
|
|||
On Wed, 3 Nov 2004 23:52:04 -0800, "Wantula"
wrote: Lynn Trapp asked me to post the actual SQL code so that it can be checked for error. The error is "Syntax error in FROM clause." SELECT Stock.Item, Sum(Stock.Quantity), Sum(Sales.[Item Bought]) FROM Stock JOIN ON Stock.Item = Sales.Item Bought GROUP BY Stock.Item SELECT Stock.Item, Sum(Stock.Quantity), Sum(Sales.[Item Bought]) FROM Stock JOIN Sales ON Stock.Item = Sales.[Item Bought] GROUP BY Stock.Item HTH Matthias Kläy -- www.kcc.ch |
#3
|
|||
|
|||
On Wed, 3 Nov 2004 23:52:04 -0800, "Wantula"
wrote: Lynn Trapp asked me to post the actual SQL code so that it can be checked for error. The error is "Syntax error in FROM clause." SELECT Stock.Item, Sum(Stock.Quantity), Sum(Sales.[Item Bought]) FROM Stock JOIN ON Stock.Item = Sales.Item Bought GROUP BY Stock.Item You're not specifying the SALES table: should be FROM Stock JOIN Sales ON Stock.Item = Sales.[Item Bought] You need the name of the table to which you are joining, and if you (unwisely, IMO) use blanks in fieldnames, you need brackets around the fieldname. John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
#4
|
|||
|
|||
ARGH! I seem to have wasted my time and effort replying to your initial post - this is why I would ask you to not post the same question multiple times!!! Update your previous post if you need a clarification!
***************************************** * A copy of the whole thread can be found at: * http://www.accessmonster.com/Uwe/For...sdbdesign/6314 * * Report spam or abuse by clicking the following URL: * http://www.accessmonster.com/Uwe/Abu...edc6e67dc65901 ***************************************** |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calculated Mean | Charles Deng | Running & Setting Up Queries | 21 | October 15th, 2004 08:37 PM |
ODBC: error conecting to SQL Server | Sergio Florez M. | General Discussion | 3 | October 4th, 2004 04:58 PM |
Access and SQL | AHopper | General Discussion | 26 | August 3rd, 2004 07:01 PM |
SQL Syntax | Joe | General Discussion | 1 | June 28th, 2004 05:21 PM |
Product Key for Office XP | P.G.Indiana | Setup, Installing & Configuration | 1 | June 7th, 2004 03:22 AM |