I have two columns in my report as below
ABC XYZ
-------------
NULL 1
NULL NULL
5 NULL
4 8
NULL 1
8 NULL
I would like to add these two values and need final result as below
1
NULL
5
12
1
8
Please help.
Thanks in advance
I think this is what you want.
Select
Case WHEN (ABC is null AND XYZ is null) THEN NULL
ELSE (Coalesce(ABC,0) + Coalesce(XYZ,0)) END as [sum]
from table
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With