Hmmm, are you trimming the variables in the IN statement? Is skillId set to
CHAR or VARCHAR? If its CHAR you should check to make sure the values
themselves in the database don't have extra spaces.
If that's all correct, make sure your form's method is "post" and not "get".
That is,
<form action="Mytemplate.cfm" method="post">
----- Original Message -----
From: "Kim Mayhall" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, February 26, 2001 11:23 AM
Subject: Building Cold Fusion Search - Dynamic SQL
> I'm trying to build some sql statements based on selections from a list
box:
>
> <select name="frmSkill">
> <option> Skill1
> <option> Skill2
> <option> Skill3
> <option> Skill4
> (etc....this size will vary as it's dynamically populated)
> </select>
>
> A user can do a multiple select, so let's say the user picked option 1 and
> option 3.
>
> On my action page, I want to pick ONLY the employees that have the 2
skills
> selected.
>
> If I use an IN statement, I get employees with one skill or the other, but
I
> only want those with both:
>
> SELECT e.empId,es.skillId
> from emp e,empSkills es
> where skillId IN (#frmSkill#)
> AND e.empId=es.empId
>
> How can I write the SQL to select only the employees with both, or do I
use
> Cold Fusion to do that?
>
> Kim Mayhall
> The Garrigan Lyman Group
> http://www.glg.com <http://www.glg.com/>
> (206) 223-5548
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists