May not be the elegant way but should work:
Rearrange the order of processing:
<cfset lCount = 0>
<cfquery name="getlist" dataSource="printprices">
SELECT * FROM purchases where
<cfloop list="#form.year#" index="i">
<cfset lCount = lCount+1>
year = '#i#' <cfif lCount NEQ ListLen(form.year)>OR </cfif>
</cfloop>
order by orderid desc
</cfquery>
-----Original Message-----
From: Orlini, Robert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 18, 2006 11:07 AM
To: CF-Talk
Subject: Select/combine two years
I wrote a search form to search for different years.
I'm using cfloop and would like a user to be able to display different
years in their search. So far it just shows one year at a time. I'm not
a daily CF programmer so I'm a bit stick here.
Any help appreciated.
Robert O.
Here is what I have:
<cfloop list="#form.year#" index="i">
<cfquery name="getlist" dataSource="printprices"> SELECT * FROM
purchases where year = '#i#'
order by orderid desc
</cfquery>
</cfloop>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257199
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4