I have a multiple-field selection / filter used to selectively display fields and filter the fields in a gridview. The bit field is causing some problems on the select filter. In my select query, I'm using:
ISNULL(dbo.theBitField, 0) AS theBitField
(@stringField1 = '' OR stringField1 LIKE @stringField1+ '%')
AND (@stringField2 = '' OR stringField2 LIKE @stringField2 + '%')
AND (@theBitField = '' OR theBitField LIKE @theBitField + '%')
I'm setting @theBitFIeld to the value of a dropdownList, where "no" maps to 0, "yes" maps to 1.
When I set the dropdownlist to "yes" or "no", it pulls up either the records with theBitField that are either 1 or explicitly set to 0, however, it's not pulling up all the records with <NULL> for theBitField when I ask for the "no" via the ddl. I would have expected the ISNULL(....,0) to have done that. May I assume that there is a different way of making this query and/or setting up the advanced properties of the DDL in order to get the NULLs along with the 0's ?
tnx in advance
This is yielding no results