Link to home
Start Free TrialLog in
Avatar of BlakeMcKenna
BlakeMcKennaFlag for United States of America

asked on

Syntax Error in SQL Statement?

Could someone please tell me where the syntax error is in the SQL Statement? I've attached the statement as an image from SSMS. All the fields are correct as well as the joins. If I replace the @unitType_ID with a valid number and run it...it works fine! I know there is a line underneath the "scaleFactor" column, however, that field does exist.
Screenshot.JPG
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

In the lower window double-click on the error, and tell us what line the cursor jumps to.  That's the error.
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You're not showing enough in that picture. Is there an END beneath the end of that query? What's above the CREATE statement?
5th line in SELECT...

scaleFactor As 'Scale Factor'

What table is it from. Do you have this field in more than one table? Try it with its table alias letter. Either it is in more than one table or it doesn't exist at all (or has typo).
Avatar of BlakeMcKenna

ASKER

Jim,

It was missing the END statement! Geez...I didn't even see that!

Thanks!