Hard to know for sure from the way you've put the question, but the IN lists seem malformed to me.

Correct:
IN ("a", "b", "c")

Incorrect:
 ("a, b, c")

Regards
Tim Romano




On 2/20/2010 6:04 PM, Wally Kolcz wrote:

I know this is out of the core topic, but I am banging my head on this
simple issue..or probably is...

I am trying to write a SQL query (in ColdFusion) for my database (MySQL
5) when I am looking for a passed in argument value in the column (which
is set as a varchar).

I am passing in '0' for the ageGroup and 'kids' for the accountType I
have 'kids'

My Query is:

Select CONCAT(roomDisplay," (National)") as roomDisplay,
CONCAT(<cfqueryparam value="#arguments.ageGroup#">,
"-", roomDisplay, "-", "National") as roomID
FROM chatrooms
WHERE <cfqueryparam value="#arguments.accountType#"> IN
(accountType)
AND <cfqueryparam value="#arguments.ageGroup#"
cfsqltype="cf_sql_integer" /> IN (ageGroups)
ORDER BY roomDisplay ASC

I have a record where 'ageGroups' is '0, 1, 2, 3, 4, 5, 6, 7, 8' and the
'accountType' is 'kids, siblings, parents'

I keep getting 0 returns but I know both values exist in at least 1 record

What am I doing wrong?





No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.435 / Virus Database: 271.1.1/2702 - Release Date: 02/21/10 
19:34:00


Reply via email to