Ive come across a problem when trying to add together two column sums.
Ive created a view with all the correct data in but when i try to execute a query like:
Select ID, Sum(ColumnA),
Sum(ColumnB)
Sum(ColumnA) + Sum(ColumnB) AS ColumnC
From View1
Group by ID
The ColumnC figure is only correct when there is data in both columns, if there is only data in ColumnB then it displays that but if there is only data in ColumnA then it doesnt.
Sometime when there isnt any data in ColumnA or B it will be NULL, so maybe this is the problem.
Hope there is a way around this.
Cheers
Try using
ISNULLto substitute zeros for NULLs: