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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 The multi-part identifier "ca.StatusID" could not

Author  Topic 

Zath
Constraint Violating Yak Guru

298 Posts

Posted - 2007-10-02 : 11:38:46
If I leave out the EquipmentHeader eh and comment the two inner joins referring to it, it runs ok.

But as is, I get the error:

The multi-part identifier "ca.StatusID" could not

And here's the select:

SELECT COUNT(*) AS CaseCount
FROM [dbo].[Case] ca, EquipmentHeader eh
INNER JOIN CaseStatus ON ca.StatusID = CaseStatus.CaseStatusID
INNER JOIN LocationLink ON ca.LocationID = LocationLink.LocationID
AND LocationLink.LocationGroupID = @locationGroupID

INNER JOIN Location l ON eh.LocationID = l.LocationID
INNER JOIN LocationLink ll ON l.LocationID = ll.LocationID

So, how to fix this?

Thanks,

Zath

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-10-02 : 11:43:24
you forgot to put the join between
FROM [dbo].[Case] ca, EquipmentHeader eh


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page
   

- Advertisement -