I'm trying to run a query than uses the IN operator in a way I've not come
across before:

<cfquery name="query" datasource="#request.DB_DSN#"
dbtype="#request.DB_type#" username="#request.DB_username#"
password="#request.DB_password#">
 SELECT title
 FROM content
 WHERE 23 IN (keywordIDs)
 AND 12 IN (keywordIDs)
</cfquery>

So, instead of saying "WHERE [a certain field] IN ([comma-separated list of
dynamic values])", I'm looking for records where a dynamic value is IN a
field that contains a comma-separated list of values. I get the error "Data
type mismatch in criteria expression."

I guess this might be an invalid use of IN (i.e. you can only use it with
the DB field on the left of the operator). Doesn't seem like something that
should be invalid - but if it is, how can I achieve the same query?

Gyrus
[EMAIL PROTECTED]
work: http://www.tengai.co.uk
play: http://www.norlonto.net
PGP key available

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to