Hello I am working on a query where I am trying to SELECT a record using the IN() function:
id is a cfparam passed in on the url and CATEGORY is a varchar.
I am getting the following error:
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Syntax error converting the varchar value '1,2,9' to a column of data type int.
Any help would be appreciated, I have tried everything!
Code:
<cfquery name="getAddresses" datasource="#application.datasource#"> SELECT ID, COMP_NAME, ADDRESS1_1, CITY1, STATE1, ZIP1, PHONE1_1, FAX1_1, CATEGORY FROM Vendors WHERE #id# IN (CATEGORY) ORDER BY COMP_NAME </cfquery>
I am getting the following error:
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Syntax error converting the varchar value '1,2,9' to a column of data type int.
Any help would be appreciated, I have tried everything!
Comment