ok... I'm new to CF and I can't exactly remember how CFLOOP works but here
goes.
<cfset status_count = 1>
<cfquery name="eventlist1">
SELECT * FROM EVENTS
WHERE PERMISSIONS IN
(
<CFLOOP>
<CFIF status_count EQ 1>
#session.status#
<cfset status_count = 2>
<CFELSE>
,#session.status#
</CFIF>
)
ORDER BY EVENT_DATE, EVENT_START ASC
</cfquery>
Assuming I remembered how CFLOOP worked, it should work. If now, I'm pretty
sure there's another way, but I can't test anything until I get into the
office. Also if PERMISSIONS is NOT an INT field, you'll need the single
quote like below.
<cfset status_count = 1>
<cfquery name="eventlist1">
SELECT * FROM EVENTS
WHERE PERMISSIONS IN
(
<CFLOOP>
<CFIF status_count EQ 1>
'#session.status#'
<cfset status_count = 2>
<CFELSE>
,'#session.status#'
</CFIF>
)
ORDER BY EVENT_DATE, EVENT_START ASC
</cfquery>
- Dae
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287752
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4