Click here to Skip to main content
15,889,876 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Statement migrated from one version of software to SQL Express there were multiple errors I have corrected those. Incorrect syntax near '='


SQL
[SELECT bdglin.ttlbdg FROM bdglin,bdglin.recnum Inner Join = {jobcst.jobnum} and bdglin.cstcde = {jobcst.cstcde}] + [SELECT sbcgln.bdgprc FROM sbcgln,sbcgln Inner Join prmchg on sbcgln.recnum = prmchg.recnum,prmchg.jobnum Inner Join = {jobcst.jobnum} and sbcgln.cstcde = {jobcst.cstcde} and prmchg.status =1]


What I have tried:

Replacing first = sign with In
Posted
Updated 20-Feb-18 11:08am
v2
Comments
PIEBALDconsult 20-Feb-18 20:15pm    
That's like no SQL I've ever seen; where did it come from?

Try pasting it into SQL Server Management Studio and see where it errors
 
Share this answer
 
Comments
Maciej Los 20-Feb-18 16:06pm    
Seems, OP has done it yet.
SQL
[SELECT bdglin.ttlbdg FROM bdglin,bdglin.recnum Inner Join = {jobcst.jobnum}
    and bdglin.cstcde = {jobcst.cstcde}] + 
[SELECT sbcgln.bdgprc FROM sbcgln,sbcgln
    Inner Join prmchg on sbcgln.recnum = prmchg.recnum,prmchg.jobnum 
    Inner Join = {jobcst.jobnum} and sbcgln.cstcde = {jobcst.cstcde} 
    and prmchg.status =1]


Copied and reformatted to make reading easier.
First... look at the 'Inner Join' on the first line; shouldn't it be:
'Inner Join on <field> = <field>'
And again on the last line.

Start with fixing those and then see what else doesn't work.
 
Share this answer
 
v2
The inner join on the first line needs a table name followed by an ON clause...then you have field = field.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900