forming a SQL statement for this scenario

  • I am having startup problem trying to form this query. Any help would be

    appreciated.

    I have a 3 tables :

    1. tblCaseInfo with CaseID, ResolutionID

    2. tblSessions with CaseID, Location

    3. tlkResolution with ResolutionID

    I need to get all resolved cases for a particular LOCATION.

    Thanks

    Arun

  • arun.samuel (3/6/2008)


    I am having startup problem trying to form this query. Any help would be

    appreciated.

    I have a 3 tables :

    1. tblCaseInfo with CaseID, ResolutionID

    2. tblSessions with CaseID, Location

    3. tlkResolution with ResolutionID

    I need to get all resolved cases for a particular LOCATION.

    Thanks

    Arun

    Select from

    tblCaseInfo C

    join tblSessions S on S.CaseID = C.CaseID

    join tblResolution R on C.ResolutionId = R.ResolutionID

    where

  • That did it.

    You made it look so easy.

    Thanks,

    Arun

  • Continuing with the above query, trying to do the following, but gives an error saying multi-part identifier S.SessionsLocName could not be bound

    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

  • There was a typo in the S.SessionsLocName, it should read S.SessionLocName

    Thanks,

    Arun

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply