March 7, 2008 at 4:18 am
I have a 3 tables :
1. tblCaseInfo with CaseID, ResolutionID
2. tblSessions with CaseID, Location
3. tlkResolution with ResolutionID
get all resolved cases for a particular LOCATION.
trying to do the following query, but gives an error saying multi-part identifier S.SessionsLocName could not be bound.
however, S.SessionsLocName is in tblSessions
SELECT COUNT(C.CaseID) AS CaseCount
FROM tblCaseInfo C
JOIN tblSessions S on S.CaseID = C.CaseID
JOIN tblResolution R on C.ResolutionID = R.ResolutionID
WHERE (S.SessionLocName = 'CMC')
Thanks,
Arun
March 7, 2008 at 4:48 am
Perhaps try a select * rather than going for the count straight away. You'll see all of your column names there. Perhaps you've misspelt the name in either the table definition or your query. If that doesn't help, please post the create table statements for your tables.
March 7, 2008 at 5:51 am
I'll try that.
Thanks for the suggestions.
March 7, 2008 at 5:54 am
arun.samuel (3/7/2008)
I have a 3 tables :1. tblCaseInfo with CaseID, ResolutionID
2. tblSessions with CaseID, Location
3. tlkResolution with ResolutionID
get all resolved cases for a particular LOCATION.
trying to do the following query, but gives an error saying multi-part identifier S.SessionsLocName could not be bound.
however, S.SessionsLocName is in tblSessions
SELECT COUNT(C.CaseID) AS CaseCount
FROM tblCaseInfo C
JOIN tblSessions S on S.CaseID = C.CaseID
JOIN tblResolution R on C.ResolutionID = R.ResolutionID
WHERE (S.SessionLocName = 'CMC')
Thanks,
Arun
Note that in your WHERE clause you are missing an "s" You mention that SessionsLocName is in your table, but you are referencing SessionLocName
Regards,
Andras
March 7, 2008 at 6:39 am
I misspelt it while posting.
The error does say TblSessions.SessionLocName.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply