USE UMDW
GO
DECLARE @TERM AS char(4)
SET @TERM = '1133'
SELECT DISTINCT a.EMPLID,
a.GRADE_POINTS,
a.UNT_TAKEN_GPA
INTO #COHORT_LIST
FROM PS_DWSA_ST_CAR_TRM a INNER JOIN playground.dbo.AY_GPA_COHORT_1213 b
ON a.EMPLID = b.EMPLID
AND a.ACAD_CAREER = b.ACAD_CAREER
WHERE a.TERM = @TERM
AND a.INSTITUTION = 'UMNTC'
AND b.SPRING = 'Y'
SELECT DISTINCT EMPLID,
SUM(a.GRADE_POINTS)/SUM(a.UNT_TAKEN_GPA) AS TERM_GPA
FROM #COHORT_LIST
WHERE GRADE_POINTS > 0.0
GROUP BY EMPLID
HAVING SUM(a.GRADE_POINTS)/SUM(a.UNT_TAKEN_GPA) > 2.9999
ORDER BY 1
DROP TABLE #COHORT_LIST
When I execute the query I get these error message. Can someone help me identify the problem
Msg 107, Level 16, State 2, Line 17The column prefix 'a' does not match with a table name or alias name used in the query.
Msg 107, Level 16, State 2, Line 17
The column prefix 'a' does not match with a table name or alias name used in the query.
Msg 107, Level 16, State 2, Line 17
The column prefix 'a' does not match with a table name or alias name used in the query.
Msg 107, Level 16, State 2, Line 17
The column prefix 'a' does not match with a table name or alias name used in the query.
Thanks