In the following insert I get the following error message:
INSERT INTO @Store (
[Reg],
[Dept],
[Amount]
) SELECT tt.Reg, tt.Dept, SUM(tt.Quantity)*
ge.[Rate_Split])
FROM [tblTrade] AS tt JOIN [Gains_Income_JournalEntry_Exceptions] AS ge
ON tt.reg = ge.[Reg]
AND tt.[Dept] = ge.[Dept]
AND tt.[Give_Up_Rate] = ge.[Give_Up_Rate_Split]
AND tt.[Prelim_Final_Ind] = @PreFin AND tt.[YrMo] = @YearMonth
GROUP BY tt.reg, tt.[Dept]
Here is the error message:
Msg 102, Level 15, State 1, Line 180
Incorrect syntax near ')'.
The error has to do with this part of the select statement:
ge.[Rate_Split])
Can anyone give me guidance on this problem? Any help is appreciated. Thanks.
INSERT INTO @Store (
[Reg],
[Dept],
[Amount]
) SELECT tt.Reg, tt.Dept, SUM(tt.Quantity)*
ge.[Rate_Split])
FROM [tblTrade] AS tt JOIN [Gains_Income_JournalEntry_Exceptions] AS ge
ON tt.reg = ge.[Reg]
AND tt.[Dept] = ge.[Dept]
AND tt.[Give_Up_Rate] = ge.[Give_Up_Rate_Split]
AND tt.[Prelim_Final_Ind] = @PreFin AND tt.[YrMo] = @YearMonth
GROUP BY tt.reg, tt.[Dept]
Here is the error message:
Msg 102, Level 15, State 1, Line 180
Incorrect syntax near ')'.
The error has to do with this part of the select statement:
ge.[Rate_Split])
Can anyone give me guidance on this problem? Any help is appreciated. Thanks.