• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 955
  • Last Modified:

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

0
smash_pants
Asked:
smash_pants
  • 2
1 Solution
 
BinuthCommented:
make sure that "StockCode" column exsists/or spelled correctly in the table dbo.tblColourways
0
 
BinuthCommented:
make sure that "StockCode" column exsists/or spelled correctly in the table "tblColourways" and "tblFreight"
0
 
smash_pantsAuthor Commented:
thanks,
tblFreight had been modified so that it no longer had the StockCode Column.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now