View Single Post
  #2 (permalink)  
Old June 15th, 2005, 06:17 PM
happygv happygv is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Leon,

May be you got to write something like this in your ASP code so that it creates as many AND conditions as that of the selected Checkboxes

NURSE ***
ACCOUNTANT ***
LAWUER ***
DOCTOR
ENGINEER
...
...

out of which the *** marked are selected. When you request for the Checkbox values, it would come as comma separated string, which you could split and have a loop from its lbound() to ubound() value and for each you got to construct an and condition for the where clause in select.

eg:
Code:
strsql = "Select * from TABLENAME where "

strList=Request.Form("chkList")
ArrChecked = split(strList)

For i=lbound(ArrChecked) to ubound(ArrChecked)
    strsql = strsql & CHARINDEX(ArrChecked(i), AMajor) > 0
    If i < ubound(ArrChecked) then strsql = strsql & " AND "
Next
Response.write strsql
Execute the output of strsql in your DB and see if the result is what you expect.

Hope that helps.
Cheers

_________________________
- Vijay G
Strive for Perfection
Reply With Quote