Having a problem using an 'IN' clause while querying a query in coldfusion 8. here is the original query:
<cfquery name="allcrafts" datasource="#APPLICATION.D
SN#">
select e.craft_ID, e.LAST_NAME, e.FIRST_NAME, e.EMP_NUM, e.ADDRESS1, e.CITY, e.PROVINCE, e.ZIP, e.PHONE, e.PHONE2, e.EMAIL, e.DATE_RECIEVED, e.DATE_ENTERED, e.BIRTH_DATE, e.DATE_HIRED, e.DATE_TERM, e.C_ID, e.RESUME, e.EXTENSION, c.CRAFT_DESC
from tbl_craft_employees e, tbl_crafts c
where (e.C_ID = c.craft_ID)
AND date_entered BETWEEN #CreateODBCDate(DateAdd("d
", APPLICATION.datenow, -184))# AND #CreateODBCDate(APPLICATIO
N.datenow)
#
order by last_name
</cfquery>
Here is the query of the above query:
<cfquery dbtype="query" name="crafts">
select craft_ID, last_name, first_name, emp_num, address1, city, province, zip, phone, phone2, email, date_recieved, date_entered, c_ID
FROM allcrafts
WHERE #URL.cID# IN ('allcrafts.c_ID')
order by last_name
</cfquery>
And I get this error
Query Of Queries runtime error.
Comparison exception while executing IN.
Unsupported Type Comparison Exception: The IN operator does not support comparison between the following types:
Left hand side expression type = "LONG".
Right hand side expression type = "STRING".
I have tried wrapping the #URL.cID# in '#URL.cID#' in an attempt to change it from a LONG datatype to a STRING. When I do so, I get this error:
Query Of Queries syntax error.
Encountered "1900 \'\'. Incorrect conditional expression, Expected one of [like|null|between|in|comp
arison] condition, Unrecognized comparison operator,
Any help is greatly appreciated. Thanks.
Start Free Trial