Or this is always handy:
<cfset list = "Event 1,Event 2">
<cfquery name="temp" datasource="#REQUEST.DSN#">
SELECT * FROM Event
WHERE Label IN (<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#list#"
list="yes">)
</cfquery>
>From my tables, not yours, but you get the idea.
Adrian
-----Original Message-----
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: 17 January 2006 20:02
To: CF-Talk
Subject: RE: Search two values in one field
If I understand this correctly, you'll be getting a value of 1,2 back in
FORM.floor. If that's the case, this should work:
<cfquery name="Getfloor" datasource="inventory">
SELECT * FROM inventory WHERE 0 = 0
<cfif IsDefined("FORM.floor") and form.floor NEQ "">
AND floor IN (#form.floor#)
</cfif>
</cfquery>
But that's only if the values of the checkboxes are numbers. If they're
strings, try this instead:
AND floor IN #ListQualify(FORM.floor, "'")#
Adrian
-----Original Message-----
From: Orlini, Robert [mailto:[EMAIL PROTECTED]
Sent: 17 January 2006 19:31
To: CF-Talk
Subject: Search two values in one field
How do I implement a search of two different values in one field?
I want to search for floors 3 and 4 in the field named "floor" and display a
report. Then html form uses checkboxes for each floor.
Here is my previous search statement with one floor per search; how can I
modify it? Thanks!
<cfquery name="Getfloor" datasource="inventory">
SELECT * FROM inventory where 0 = 0
<CFIF IsDefined("FORM.floor") and form.floor NEQ "">
And floor = '#trim(form.floor)#'
</CFIF>
</cfquery>
Robert Hww
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:229798
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54