A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

SQL Syntax Error



 
 
Thread Tools Display Modes
  #1  
Old November 4th, 2004, 07:52 AM
Wantula
external usenet poster
 
Posts: n/a
Default 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  
Old November 4th, 2004, 10:39 AM
Matthias Klaey
external usenet poster
 
Posts: n/a
Default

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  
Old November 4th, 2004, 04:15 PM
John Vinson
external usenet poster
 
Posts: n/a
Default

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  
Old November 9th, 2004, 01:01 AM
David Seeto via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 12:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.