Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Join error message

Status
Not open for further replies.

hedgracer

Programmer
Joined
Mar 21, 2001
Messages
186
Location
US
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.
 
You're right about the part of the statement.

Code:
SUM[!]([/!]tt.Quantity[!])[/!]* ge.[Rate_Split][!])[/!]

You have one open parenthesis and 2 close parenthesis. Fix that and you should be ok.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top