Hi,
I have a query that adds together a number of bit fields together to basically give me the "number of true values" for a record:
My problem is that either bol_field1 or bol_field2 can be null. So when one of them is null, the "trueCount" alias returns null.
Is there a way to make bol_field1 = 0 or bol_field2 = 0 if they're in fact null?
Thanks for any help!
I have a query that adds together a number of bit fields together to basically give me the "number of true values" for a record:
Code:
select field1, field2, cast(bol_field1 as int) + cast(bol_field2 as int) as trueCount
from myTable
My problem is that either bol_field1 or bol_field2 can be null. So when one of them is null, the "trueCount" alias returns null.
Is there a way to make bol_field1 = 0 or bol_field2 = 0 if they're in fact null?
Thanks for any help!