PreacherUK
Technical User
Hi Guys
I've got a query here, its returning the following error:
( I find that pasting the below query into notepad or text editor of your choice lets you see the formatting properly)
Select *
FROM dbo.tblMonthEndEstimate LEFT OUTER JOIN
(SELECT AssetClass, SecurityDescription
FROM dbo.tblGLNUtilisation
GROUP BY SecurityDescription, AssetClass, AssetClass
HAVING (AssetClass <> '000') AND (AssetClass <> '999')) ON dbo.tblMonthEndEstimate.AssetType = dbo.tblGLNUtilisation.AssetClass
Error:
Server: Msg 156, Level 15, State 1, Line 91
Incorrect syntax near the keyword 'ON'.
Am I using the sub query correctly? Do I need to use alias's
I've got a query here, its returning the following error:
( I find that pasting the below query into notepad or text editor of your choice lets you see the formatting properly)
Select *
FROM dbo.tblMonthEndEstimate LEFT OUTER JOIN
(SELECT AssetClass, SecurityDescription
FROM dbo.tblGLNUtilisation
GROUP BY SecurityDescription, AssetClass, AssetClass
HAVING (AssetClass <> '000') AND (AssetClass <> '999')) ON dbo.tblMonthEndEstimate.AssetType = dbo.tblGLNUtilisation.AssetClass
Error:
Server: Msg 156, Level 15, State 1, Line 91
Incorrect syntax near the keyword 'ON'.
Am I using the sub query correctly? Do I need to use alias's