MickeySox, This isn't answering you question directly but...
This should get you the data without duplicating Volume or require the third (fourth, fifth, etc.) joins:
Code:
SELECT T1.SUMMARY_DATE, T1.ACCOUNT_NO, T1.SORT_CODE, T2.VOL001, T2.VOL002
FROM table1 AS T1
LEFT OUTER JOIN
(SELECT SUMMARY_DATE, SORT_CODE, ACCOUNT_NO
, MAX( CASE WHEN TYPE = 'A' THEN VOL END ) AS VOL001
, MAX( CASE WHEN TYPE = 'B' THEN VOL END ) AS VOL002
FROM table2
GROUP BY SUMMARY_DATE, SORT_CODE, ACCOUNT_NO
) AS T2
ON T1.SUMMARY_DATE = T2.SUMMARY_DATE
AND T1.ACCOUNT_NO = T2.ACCOUNT_NO
AND T1.SORT_CODE = T2.SORT_CODE
Basically, it is transposing the rows to columns on TABLE2 before joining to table1.
You would still have to alter the code to add a new VOLxxx to the Select and another MAX(CASE...) to the nested table query. The good news is that it would be a much smaller change. Also, the performance wouldn't decrease very much as more TYPEs are added (as opposed to adding another join for every TYPE).
But altering the code is 'almost' unavoidable. I can think of two potential ways around this (they may not be the best ways or even the only ways).
A) If you know what the new TYPEs will be (C, D, E,..., Z), you could go ahead and code all 26 letters of the alphabet (in this example), and have VOL001 through VOL026 in the Select list and 26 MAX(CASE...) statements.
This way as, the new code is added, no changes are needed (until you try to get past Z).
If you didn't like the 'extra' columns on your output, you could create a View with just the current valid TYPES and not all the 'future expansion' TYPES. However, you would still need to change the View as new Types are added.
B) Dynamically build the SQL. I don't use this and may not explain it well. In essence you would build up a character string that contains the SQL you will be running. First you would have to query table2 to find the MAX number of TYPES. Then you would start building the SQL statement:
SQLSTATEMENT = 'SELECT T1.SUMMARY_DATE, T1.ACCOUNT_NO, T1.SORT_CODE'
Loop from 1 to Max types
SQLSTATEMENT = SQLSTATEMENT + ', VOL' + character(loop value)
end loop
SQLSTATEMENT = SQLSTATEMENT + 'FROM...ACCOUNT_NO'
loop from 1 to Max Types
SQLSTATEMENT = SQLSTATEMENT = ', MAX(CASE...) AS VOL' + charter(loop value)
end loop
SQLSTATEMENT + 'FROM...T2.SORT_CODE'
(Problems: How to put in the comparison types ( = 'A', = 'B', etc.) and how to handle embedded apostrophes).
This is VERY rough pseudo code but hopefully you get the idea.
Then you have to prepare/execute the SQLSTATEMENT.
PS Beyond the general idea, I am not very proficient with generating dynamic SQL. If you have question, I probably can't answer them.