Link to home
Start Free TrialLog in
Avatar of smash_pants
smash_pantsFlag for Australia

asked on

Invalid column name SQL

How do i get past the following error:

Invalid column name 'StockCode'.
declare @Table table(Code varchar(50), Qty int) 
 
--data inserted into table here
 
SELECT     dbo.tblColourways.StockCode,
dbo.tblColourways.CartonWeight / dbo.tblColourways.Volume AS Density,
dbo.tblColourways.CartonQuantity, 
dbo.tblColourways.Duty, 
tblFreight.Minimum,
tblFreight.FuelPerc, 
tblFreight.Base
 
FROM       @Table tbl 
INNER JOIN  dbo.tblColourways ON tbl.Code = dbo.tblColourways.StockCode  
INNER JOIN tblFreight ON dbo.tblColourways.StockCode = tblFreight.StockCode

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Binuth
Binuth
Flag of India 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
make sure that "StockCode" column exsists/or spelled correctly in the table "tblColourways" and "tblFreight"
Avatar of smash_pants

ASKER

thanks,
tblFreight had been modified so that it no longer had the StockCode Column.