Try using this:

where Username IN <cfqueryparam cfsqltype="cf_sql_varchar" list="yes"
value="#userlist#" separator=",">

> -----Original Message-----
> From: Ewok [mailto:[EMAIL PROTECTED]
> Sent: Sunday, August 08, 2004 5:46 PM
> To: CF-Talk
> Subject: SELETCT IN (LISTOFSTRINGS)
>
> I don't know whats going on here...but as long as the list has only one
> item in it, it works... once it gets more than one it bombs.
>
> <cfset UserList = "Userone,UserTwo,UserThree">
>
> <cfquery name="registeredusers" datasource="MyDSN">
>     select Username, UserID from tbl__Users
>     where Username IN ('#userlist#')
>     order by Username
> </cfquery>
>
>
> does each item need single quotes and take the single quotes out of the
> query???
> if i hardcode the list in the query it needs single quotes around each one
> so Im assuming thats it. Is there an easy way to surrond each item with
> single quotes if thats the case?
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to