Try without the apostrophes

   SELECT ItemID, Description FROM Items
   WHERE ItemName IN (#ItemNames#)

-----Original Message-----
From: Perez, Bismark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 20, 2000 2:55 PM
To: CF-Talk
Subject: List field been used as a retrieval argument


Hello list,

I have a problem I can't see to find the answer... I have a list field I
want to use as a retrieval argument of a query, but some how the database
don't like the way I'm defining the retrieval... for the life of me I can't
see where the error is, maybe you guys can help...  the following is an
example of the code

<cfset ItemNames = "'Item1','Item2','Item34'">

<cfquery ....
   SELECT ItemID, Description FROM Items
   WHERE ItemName IN '(#ItemNames#)'
</cfquery...

I have tried to even include the parenthesis in the ItemNames field with not
luck... if I use the statement on an interactive SQL it returns records so I
know the statement works...

Bismarck Perez


**********************************************************************
Information in this email is confidential and may be privileged. 
It is intended for the addressee only. If you have received it in error,
please notify the sender immediately and delete it from your system. 
You should not otherwise copy it, retransmit it or use or disclose its
contents to anyone. 
Thank you for your co-operation.
**********************************************************************

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to