Advertisement

04.28.2008 at 08:45PM PDT, ID: 23360976
[x]
Attachment Details

Using 'IN' operator in ColdFusion Query of Queries throwing error

Asked by WCD_Support in ColdFusion Application Server, Databases Miscellaneous, Cold Fusion Markup Language

Tags: ,

Having a problem using an 'IN' clause while querying a query in coldfusion 8.  here is the original query:

      <cfquery name="allcrafts" datasource="#APPLICATION.DSN#">
      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(APPLICATION.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|comparison] condition, Unrecognized comparison operator,


Any help is greatly appreciated.  Thanks.Start Free Trial
 
Loading Advertisement...
 
[+][-]04.28.2008 at 08:54PM PDT, ID: 21459582

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 09:04PM PDT, ID: 21459630

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 09:12PM PDT, ID: 21459663

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: ColdFusion Application Server, Databases Miscellaneous, Cold Fusion Markup Language
Tags: ColdFusion, SQL, Comparison exception while executing IN.
Sign Up Now!
Solution Provided By: ee_rlee
Participating Experts: 3
Solution Grade: B
 
 
[+][-]04.28.2008 at 09:28PM PDT, ID: 21459706

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.28.2008 at 09:29PM PDT, ID: 21459707

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 07:42AM PDT, ID: 21462729

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 08:24AM PDT, ID: 21463139

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 07:14PM PDT, ID: 21467662

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 09:23PM PDT, ID: 21468057

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 09:31PM PDT, ID: 21468083

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 09:41PM PDT, ID: 21468124

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 09:57PM PDT, ID: 21468169

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 11:52PM PDT, ID: 21468584

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.30.2008 at 08:58AM PDT, ID: 21471974

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628