
October 18th, 2004, 01:51 PM
|
|
Contributing User
|
|
Join Date: May 2004
Posts: 180
Time spent in forums: 1 Day 9 h 3 m 58 sec
Reputation Power: 5
|
|
|
Need help with sql statement
I have a form that contains 6 checkboxes. I need my sql statement to be able to handle the combination of selected checkboxes.
I am having trouble writing my sql to accept any combination of selected checkboxes.
Right now I have this:
Select SystemNetName From Host
Where
(Site = location1 OR
Site = location2 OR
Site = location3 ) OR
UseType = usetype1 OR
UseType = usetype2 OR
UseType = usetype3) AND
Active_Inactive = active
This sql statement does not accomodate for empty 'None' in any of these fields. Ideally, it should work like this: IF I leave one of the checkboxes blank it should not try to query it as an empty field.
Any Suggestions?
-Laura
|