<!--- This example uses ListValueCountNoCase to see how many 
	  employees are in a department --->
<HTML>
<HEAD>
<TITLE>ListValueCountNoCase Example</TITLE>
</HEAD>

<BASEFONT FACE="Arial, Helvetica" SIZE=2>

<BODY  bgcolor="#FFFFD5">

<CFQUERY Name="SearchByDepartment" DATASOURCE="cfsnippets">
SELECT 	Department
FROM 	Employees
</CFQUERY>

<H3>ListValueCountNoCase Example</H3>
<P>This example uses ListValueCountNoCase to see how many employees 
are in a department.

<FORM ACTION="listvaluecountnocase.cfm" METHOD="POST">
<P>Select a department:</P>
	<SELECT NAME="departmentName">
			<OPTION VALUE="Accounting">
				Accounting
			</OPTION>	
			<OPTION VALUE="Administration">
				Administration
			</OPTION>	
			<OPTION VALUE="Engineering">
				Engineering
			</OPTION>	
			<OPTION VALUE="Sales">
				Sales
			</OPTION>							
	</SELECT>
	</SELECT>
<INPUT TYPE="Submit" NAME="Submit" VALUE="Search Employee List">
</FORM>
<!--- wait to have a string for searching defined --->
<CFIF IsDefined("form.Submit") and IsDefined("form.departmentName")>
	<CFSET myList = ValueList(SearchByDepartment.Department)>
	<CFSET numberInDepartment = ListValueCountNoCase(myList, form.departmentName)> 
		 
	<CFIF numberInDepartment is 0>
		<H3>There are no employees in <CFOUTPUT>#form.departmentName#</CFOUTPUT></H3>
	<CFELSEIF numberInDepartment is 1>
		<CFOUTPUT>
		<P>There is only one person in #form.departmentName#.
		</CFOUTPUT>
	<CFELSE>
		<CFOUTPUT>
		<P>There are #numberInDepartment# people in #form.departmentName#.
		</CFOUTPUT>
	</CFIF>
</CFIF>

</BODY>
</HTML>       