You are using COALESCE at the wrong level.
If you use a NULL value in a calculation then the entire result becomes NULL. What you seem to want is to treat each NULL value as 0 and use the 0 in the calculation.
Here is a very simple example of what I mean
DECLARE @table TABLE (Col1 INT NULL, Col2 INT NULL)
INSERT INTO @table (Col1, Col2) VALUES
(NULL, NULL),
(10, NULL),
(NULL, 10),
(20, 5),
(5, 20)
If I want to list the differences between Col1 and Col2 for each row I might start out with something like this:
SELECT Col1 - Col2 FROM @table
But that will give me the results:
NULL
NULL
NULL
15
-15
Your query is doing the equivalent of:
SELECT COALESCE(Col1 - Col2,0) FROM @table
which gives the results
0
0
0
15
-15
My way would be to write the query as:
SELECT ISNULL(Col1,0) - ISNULL(Col2,0) FROM @table
Results:
0
10
-10
15
-15
So, points to note:
a) I'm coalescing each column
individually
b) I've used ISNULL instead of COALESCE. They do exactly the same thing but ISNULL is (apparently) marginally faster when you only have the two items to coalesce. And it is a bit quicker to type :-)
Your query should look something like
SELECT A.BRNNAME,A.SCORE , COALESCE(A.Q1Y1C, 0) Q1Y1C , COALESCE(C.Q1Y2C, 0) Q1Y2C ,
COALESCE(A.Q2Y1C, 0) Q2Y1C , COALESCE(C.Q2Y2C, 0) Q2Y2C ,
COALESCE(A.Q3Y1C, 0) Q3Y1C , COALESCE(C.Q3Y2C, 0) Q3Y2C ,
COALESCE(A.Q4Y1C, 0) Q4Y1C , COALESCE(C.Q4Y2C, 0) Q4Y2C,
ISNULL(C.Q1Y2C,0)-ISNULL(A.Q1Y1C,0) DIFFCQ1C ,
ISNULL(C.Q2Y2C,0)-ISNULL(A.Q2Y1C, 0) DIFFCQ2C ,
ISNULL(C.Q3Y2C,0)-ISNULL(A.Q3Y1C, 0) DIFFCQ3C ,
ISNULL(C.Q4Y2C,0)-ISNULL(A.Q4Y1C, 0) DIFFCQ4C
FROM Y1C A
JOIN Y1P B ON A.BRNNAME=B.BRNNAME AND A.SCORE=B.SCORE
JOIN Y2C C ON A.BRNNAME=C.BRNNAME AND A.SCORE=C.SCORE
JOIN Y2P D ON A.BRNNAME=D.BRNNAME AND A.SCORE=D.SCORE
ORDER BY A.BRNNAME
but obviously I haven't been able to test this.