December 24, 2008 at 2:45 am
Hello,
I have a table which contains a bit datatype field called CancelFlag.
How can I check whether CancelFlag value is not true?
Thanks & Regards.
December 24, 2008 at 3:04 am
Where CancelFlag = 0
A bit holds values of 1 or 0. By convention, 0 is false and 1 is true, though there's nothing in SQL that enforces that.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 24, 2008 at 3:13 am
thanks .
but the column contains True,False & NULL value and i want all rows which doesn't contain True value.
December 24, 2008 at 3:24 am
ankur (12/24/2008)
but the column contains True,False & NULL value and i want all rows which doesn't contain True value.
Where Coalesce(CancelFlag, 0) = 0
December 24, 2008 at 3:31 am
It works.
Thank you very much.
December 24, 2008 at 4:41 am
The Stright forward statement is
WHERE CancelFlag = 'False' or CancelFlag IS NULL
The bit datatype allows you to compare the column with value 'True' or 'False'
Venkat
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply