Also, don't forget- cfqueryparam is your friend

<cfqueryparam value="#session.status#" separator="," list="Yes>



> -----Original Message-----
> From: Adkins, Randy [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 04, 2007 11:39 AM
> To: CF-Talk
> Subject: RE: SQL select where in headache
> 
> if session.status is a numeric list and PERMISSIONS is a numeric value,
> remove the single quotes:
> 
> WHERE PERMISSIONS IN (#session.status#)
> 
> 
> ________________________________
> 
> From: Hugh Fidgen [mailto:[EMAIL PROTECTED]
> Sent: Tue 9/4/2007 3:24 PM
> To: CF-Talk
> Subject: SQL select where in headache
> 
> 
> 
> Hiya,
> 
> I've got a problem selecting data from a table and I was wondering if
> anyone could help.
> 
> Code so far:
> 
> <cfquery name="eventlist1">
>   SELECT * FROM EVENTS
>   WHERE PERMISSIONS IN ('#session.status#')
>   ORDER BY EVENT_DATE, EVENT_START ASC
> </cfquery>
> 
> This works fine where field permissions = 1 but when permissions = 1,2,x,x
> and so on the query fails. Basically - how can I loop through the comma
> delimeted values in the permissions variable and compare them each against
> #session.status# until a match is found.
> 
> Thanks so much,
> Hugh
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287719
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to