Click to See Complete Forum and Search --> : SQL "WHERE" Statement Boolean filtering question


Nostromo77
05-27-2008, 10:53 AM
I suspect that my question will have a hair-pullingly-easy answer, but I can't find any mention of it in my ASP.NET books:

I have a table of items where one column is a boolean checkbox field called "Approved". I want to display records from this field in my gridview control only where "Approved" = TRUE.

In order to filter data by this boolean field, should I use a WHERE statement such as "WHERE Approved = 1 ", or an IN operator statement such as "WHERE Approved IN ("TRUE"), or some other construction?

Thank you very much for your help.

gil davis
05-27-2008, 12:49 PM
You have not indicated what type of db you are using. If SQL, then usually checkboxes are "bit" types which contain either 1 or 0. If it is something else, you'll have to post back.