By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,760 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,760 IT Pros & Developers. It's quick & easy.

problem sql query

P: 22
Hi Mary
this is the problem child (query)
<!---Query db for page info--->
<cfquery name="showtopics" datasource="parrots">
SELECT categories.catID, threads.threadID, threads.posttype, threads.topic, threads.topicID, threads.memberID, threads.username, threads.postdate, categories.category, T2.CountReplies
FROM (categories LEFT JOIN threads ON categories.catID = threads.catID) LEFT JOIN (SELECT topicID, Sum(IIf([posttype]=2,1,0)) As CountReplies
FROM threads GROUP BY topicID) AS T2 ON threads.topicID = T2.topicID
WHERE categories.catID=#url.catID# AND (posttype=1 OR posttype Is Null)
ORDER BY threads.threadID DESC;
</cfquery>

The error i get is in dreamweaver when i try to list the contents of a recordset in the bindings panel - when i click on the little plus sign i get this error which includes this

-1:[Macromedia][SequelLink JDBC Driver][obdc Socket][Microsoft][OBDC Microsoft Access Driver]
Syntax error (missing operator) in query expression 'categories.catID=AND (postype=1 OR posttype Is Null)'


java .sql.SQLException: [Macromedia][SequelLink JDBC Driver][obdc Socket][Microsoft][OBDC Microsoft Access Driver]
Syntax error (missing operator) in query expression 'categories.catID=AND (postype=1 OR posttype Is Null)'
Jun 3 '07 #1
Share this Question
Share on Google+
2 Replies

MMcCarthy
Expert Mod 10K+
P: 14,534
OK as the error you are getting is ...

Expand|Select|Wrap|Line Numbers
  1. syntax error (missing operator) in query expression 'categories.catID=AND (postype=1 OR posttype Is Null)'
Then #url.catID# isn't returning anything
Jun 3 '07 #2

acoder
Expert Mod 15k+
P: 16,027
OK as the error you are getting is ...

Expand|Select|Wrap|Line Numbers
  1. syntax error (missing operator) in query expression 'categories.catID=AND (postype=1 OR posttype Is Null)'
Then #url.catID# isn't returning anything
Yes, that's right. Check the URL for "catID=". You'll probably see that it's empty, or, if you've used cfparam for default values, it doesn't exist at all.
Jun 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.