MySQL InnerJoin query syntax error?
I can't seem to locate the syntax error in this MySQL query. Coldfusion says there an error in my sql syntax. Here is the query. Anyone have any clues on this?
<cfquery name="queryItem" datasource="bonus">
select
p.productid,
p.modelnumber,
p.modeldescription,
sp.sp_bonusamount as Amount
from
products i join bonusproducts sp on i productid = sp.sp_productid
inner join program p on sp.sp_programid = p.programid
where
p.CompanyOrgLevelID in (#getParentCompanyOrgLevelIDList(session.CompanyOrgLevelID)#)
and p.ProgramID = #programID#
<cfif categoryID gt 0>
and CategoryID in (#getSubcategoryIDList(categoryID)#)
</cfif>
order by
#sortColumn# #sortDirection#
</cfquery>
