Replace your Where with an "AND/OR" The where clause must be used after any inner joins SELECT v.Party, SUM(v.Votes), s.ConstituencyNo ,c.ConstituencyName, c. RegionCode FROM VoteResults v INNER JOIN PollingStation s ----------------------------------------------- ON v.AgentPhoneNo = s.AgentPhoneNo AND v.ResultCategory = 'L' AND v.Party = 'NPP'
INNER JOIN Constituency c ON c.ConstituencyNo = s.ConstituencyNo ------------------------------------------------- GROUP BY v.Party, s.ConstituencyNo, ,c.ConstituencyName, c.RegionCode > I am trying to use INNER JOIN for my query and have additional > conditions, what is the right way to add them? When I run the code > below, I get the error shown. How do I get this to work? > > SELECT v.Party, SUM(v.Votes), s.ConstituencyNo ,c.ConstituencyName, c. > RegionCode > FROM VoteResults v INNER JOIN PollingStation s > ON v.AgentPhoneNo = s.AgentPhoneNo > WHERE v.ResultCategory = 'L' AND v.Party = 'NPP' > INNER JOIN Constituency c > ON c.ConstituencyNo = s.ConstituencyNo > GROUP BY v.Party, s.ConstituencyNo, ,c.ConstituencyName, c.RegionCode > > > Error: > > Error Executing Database Query. > [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC > Microsoft Access Driver] Syntax error (missing operator) in query > expression 'v.ResultCategory = 'L' AND v.Party = 'NPP' INNER JOIN > Constituency c ON c.ConstituencyNo = s.ConstituencyNo'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:300444 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4