Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Problems searching with bit fields

Author  Topic 

kgruber
Starting Member

6 Posts

Posted - 2001-06-11 : 12:14:37
I have a search form with several groups of checkboxes. Obviously, the user can check off one or several items in each group. For example, say the first group contains the options: apples, oranges, bananas. If the user only cares about apples, they will check just that box. In my database, there is a bit field for each fruit, indicating whether or not its available in a particular store.
How would I write a stored procedure such that it returns all stores selling apples? If I set a default value of 0 for all unchecked boxes, then the search returns only stores that sell EXCLUSIVELY apples. Is there way to specifiy a wildcard for a bit field or is there another simple way that I am just unaware of?

   

- Advertisement -