I have a large query that pulls data, see file 1. I have a small query that sums data from one of the same tables shown in file 2. I am trying to combine the two together to that I get the 'Balance' in the large query. I have tried doing this as shown in file 3. However get a syntax error sayng 'Msg 156, Level 15, State 1, Line 118
Incorrect syntax near the keyword 'AS'.
Can someone let me know what I'm doing wrong. Many thanks.