# How to SUM Bit Fields in SQL

By default, SQL Server doesn’t allow an operation like this:

```
SELECT SUM(blnBitColumn) FROM tblTable;
```

In order to achieve this result, you must first convert the bit column to a numeric type:

```
SELECT SUM(CONVERT(int,blnBitColumn)) FROM tblTable;
```

This counts the number of times the bit is **true**.

If you want to get the flip-side of that to see how many times the bit is **false**, just subtract the total number of bits from the positive:

```
SELECT COUNT(blnBitColumn)-SUM(CONVERT(int,blnBitColumn)) FROM tblTable;
```