Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select statement computed column error

Author  Topic 

madhan
Yak Posting Veteran

59 Posts

Posted - 2015-02-10 : 13:16:25
I am receiving error msg on the below query line as "incorrect syntax near MSF" , "Incoorect syntanx near ExtCost", "incorrect syntax near From on line 28"


SELECT
xxxcolumns,
(rj.RECEIVEDLINEAL * ((r.WIDTH / 12.0)) / 1000.0 MSF,
Case
when rv.PricePerCode = 'MSF' Then
((rj.RECEIVEDLINEAL * (r.WIDTH / 12.0)) / 1000.0) * rv.price
Else
(rj.RECEIVEDWEIGHT) * rv.price
end ExtCost,
xxxcolumns1,
(
SELECT tablename.columnName
FROM tablename
)
FROM tablename1 rj ---line 28
inner join ....


please help fixing those three errors.

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2015-02-10 : 13:27:25
You have fewer right brackets than left brackets. Perhaps this - even without any of those brackets, the logic will remain the same
...
xxxcolumns,
rj.RECEIVEDLINEAL * r.WIDTH / 12.0 / 1000.0 MSF,
...
Go to Top of Page
   

- Advertisement -