Solved

Error in my FROM Statement but dont know where ??

Posted on 2008-09-29
4
163 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:xDJR1875
Comment Utility
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
Comment Utility
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:
xDJR1875 earned 500 total points
Comment Utility
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
Comment Utility
great. thank you very much indeed.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Access DLookup 18 28
SQL Round a percentage 2 23
2 Access tables, count verbiage used 6 19
encyps queries mssql 15 22
Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now