Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Error in my FROM Statement but dont know where ??

Posted on 2008-09-29
4
165 Views
Last Modified: 2010-03-20
Hi all,

can someone run their eyes over this. i'm getting the following error message:

Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.  
 
The error occurred in C:\Inetpub\wwwroot\woodbits\index.cfm: line 1
 
1 : <cfquery name="GetRecProducts" datasource="#request.dsn#" username="#request.dsn#" password="#request.dsn#">
2 : SELECT tbl_prdtcategories.category_ID, tbl_products.product_Name,
3 : tbl_products.product_Description, tbl_products.product_Archive,
 

the code is :

<cfquery name="GetRecProducts" datasource="#request.dsn#" username="#request.dsn#" password="#request.dsn#">
SELECT tbl_prdtcategories.category_ID, tbl_products.product_Name, 
tbl_products.product_Description, tbl_products.product_Archive, 
tbl_prdtimages.prdctImage_FileName
FROM tbl_products
INNER JOIN tbl_prdtcategories
INNER JOIN tbl_prdtcat_rel ON
tbl_prdtcategories.category_ID = tbl_prdtcat_rel.prdt_cat_rel_Cat_ID ON
tbl_products.product_ID = tbl_prdtcat_rel.prdt_cat_rel_Product_ID
INNER JOIN tbl_prdtimages ON
tbl_products.product_ID = tbl_prdtimages.prdctImage_ProductID
WHERE tbl_prdtcategories.category_ID=6
AND tbl_products.product_Archive=0
</cfquery>

Open in new window

0
Comment
Question by:bede123
  • 2
  • 2
4 Comments
 
LVL 17

Expert Comment

by:Daniel Reynolds
ID: 22597821
you are missing the ON statement condition for the first inner join
FROM tbl_products
INNER JOIN tbl_prdtcategories   <ON   blah>
0
 
LVL 1

Author Comment

by:bede123
ID: 22598358
thanks. i dont suppose you can help me some more. this code was written for me so i'm really not sure what exactly should go after the ON


INNER JOIN tbl_prdtcategories

0
 
LVL 17

Accepted Solution

by:
Daniel Reynolds earned 500 total points
ID: 22598424
I have modified the query a bit and moved some join info around.

This should be what the author intended.

SELECT tbl_prdtcategories.category_ID
    , tbl_products.product_Name
    , tbl_products.product_Description
    , tbl_products.product_Archive
    , tbl_prdtimages.prdctImage_FileName
FROM tbl_products
INNER JOIN tbl_prdtcategories ON tbl_prdtcategories.category_ID = tbl_prdtcat_rel.prdt_cat_rel_Cat_ID
INNER JOIN tbl_prdtcat_rel ON tbl_products.product_ID = tbl_prdtcat_rel.prdt_cat_rel_Product_ID
INNER JOIN tbl_prdtimages ON tbl_products.product_ID = tbl_prdtimages.prdctImage_ProductID
WHERE tbl_prdtcategories.category_ID=6
AND tbl_products.product_Archive=0


0
 
LVL 1

Author Comment

by:bede123
ID: 22598973
great. thank you very much indeed.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ajaxSubmit is giving me an error 1 47
export sql results to csv 6 39
T-SQL: Do I need CLUSTERED here? 13 59
Access join syntax when converting to T-SQL query 4 33
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question