title: Error message "The multi part identifier could not be bound"
body: <p>My code is:</p>
  
  <pre><code>  ,CASE WHEN ResidenceInd = 1 THEN 'Residence' ELSE  'Day' END AS ClassType
    ,sc.Score
    ,'1' AS IsLP
    ,IncludeInGraph
    ,LessonOrder
  FROM (
    SELECT
      sc.SchoolId
      ,sc.StudentId
      ,sc.DSTempSetColCalcId
      ,dcal.CalcType
      ,hdr.LessonPlanId
      ,hdr.StdtClassId
      ,Cls.ResidenceInd
      ,dcal.IncludeInGraph
      ,DHDR.LessonOrder
    FROM StdtSessColScore sc
      INNER JOIN DSTempSetColCalc dcal
        ON dcal.DSTempSetColCalcId = sc.DSTempSetColCalcId
      INNER JOIN StdtSessionHdr hdr
        ON hdr.StdtSessionHdrId=sc.StdtSessionHdrId
      INNER JOIN Class Cls 
        ON Cls.ClassId=hdr.StdtClassId 
      INNER JOIN DSTempHdr DHDR 
        ON DHDR.DSTempHdrId=hdr.DSTempHdrId
    WHERE 
     hdr.IOAInd='N' 
     AND hdr.SessMissTrailStus ='N' 
     AND hdr.SessionStatusCd='S' 
     AND (SELECT StatusId 
          FROM DSTempHdr DS 
          WHERE DS.DSTempHdrId = hdr.DSTempHdrId)
          &lt;&gt;
          (SELECT LookupId 
          FROM LookUp 
          WHERE LookupType = 'TemplateStatus' 
           AND LookupName='Deleted') 
    GROUP BY 
      DHDR.LessonOrder
      ,sc.SchoolId
      ,sc.StudentId
      ,sc.DSTempSetColCalcId
      ,dcal.CalcType
      ,hdr.LessonPlanId
      ,hdr.StdtClassId
      ,Cls.ResidenceInd
      ,dcal.IncludeInGraph
    ) AS StdCalcs
    ,ReportPeriod
  WHERE 
    StdCalcs.StudentId=1240 
    AND CONVERT(DATE,'2016/01/02') &lt;= CONVERT(DATE,ReportPeriod.PeriodDate)
    AND CONVERT(DATE,ReportPeriod.PeriodDate) &lt;= CONVERT(DATE,'2016/12/28')
    AND sc.SchoolId = StdCalcs.SchoolId 
    AND sc.StudentId = StdCalcs.StudentId
    AND sc.DSTempSetColCalcId = StdCalcs.DSTempSetColCalcId
    AND CONVERT(DATE, Hdr.EndTs) = CONVERT(DATE, ReportPeriod.PeriodDate)
    AND Hdr.LessonPlanId = StdCalcs.LessonPlanId
    AND dcal.CalcType = StdCalcs.CalcType 
    AND Hdr.StdtClassId = StdCalcs.StdtClassId
    AND Hdr.IOAInd = 'N' AND Hdr.SessMissTrailStus ='N' 
    AND Hdr.SessionStatusCd = 'S' 
    AND sc.Score &gt;= 0 
    AND Hdr.IsMaintanace = 0
  GROUP BY 
  </code></pre>
  
  <p>Code continues... </p>
  
  <p>I'm getting a error :</p>
  
  <blockquote>
    <p>multipart identifier sc.SchoolId,sc.StudentId,sc.DSTempSetColCalcId,Hdr.EndTs,Hdr.LessonPlanId,dcal.CalcType,Hdr.StdtClassId,Hdr.IOAInd,Hdr.SessMissTrailStus,Hdr.SessionStatusCd,sc.ScoreHdr.IsMaintanace could not be bound. </p>
  </blockquote>
  
  <p>actually how can we resolve it.. i was trying to add sc.score and </p>
  
  <pre><code>AND sc.SchoolId = StdCalcs.SchoolId 
  AND sc.StudentId = StdCalcs.StudentId
  AND sc.DSTempSetColCalcId = StdCalcs.DSTempSetColCalcId 
  AND CONVERT(DATE, Hdr.EndTs) = CONVERT(DATE, ReportPeriod.PeriodDate)
  AND Hdr.LessonPlanId=StdCalcs.LessonPlanId 
  AND dcal.CalcType = StdCalcs.CalcType 
  AND Hdr.StdtClassId = StdCalcs.StdtClassId
  AND Hdr.IOAInd = 'N' AND Hdr.SessMissTrailStus = 'N'
  AND Hdr.SessionStatusCd = 'S' 
  AND sc.Score &gt;= 0 
  AND Hdr.IsMaintanace=0
  </code></pre>
  
  <p>Any help is appreciated</p>