I have something like this

```
CASE WHEN j.DocTypeID=0 AND CreditOrDebit = 'd' THEN SecDebit END AS 'debit',
CASE WHEN j.DocTypeID=0 AND CreditOrDebit = 'c' THEN SecCredit END AS 'credit',

```

I want to calculate difference between debit and credit 

If i am using 

```
Bal=CASE WHEN j.DocTypeID=0 AND CreditOrDebit = 'd' THEN SecDebit END  - CASE WHEN j.DocTypeID=0 AND CreditOrDebit = 'c' THEN SecCredit END,

```

It is giving me null value, what is wrong in this statement can anyone advice what to do here.