The attached stored proc is getting an error on t.MemberGUID:
"The multi-part identifier 't.MemberGUID" could not be found."
The last time I has this error, it was becasue I was referencing a field without referencing the table in the FROM clause. This is clearly not the case here. Ideas?
SELECT Member.MemberID, '01/01/1900' as servicedate
, 'HRA-Triglyceride' as loincCode,null as cpt_Code
, a.hramadAnswer as llc_Value
FROM HRAMemAnswerData a WITH(NOLOCK), PopulationTask t, HRAGroupQuestions gq, HRAQuestion q
INNER JOIN Member ON Member.MemberGUID=t.MemberGUID
where a.PopulationTaskID = t.PopulationTaskID And a.HragqID = gq.HragqID
And gq.HragqChildqID = q.HraqID and hraqid = 19 and Member.MemberID = @MemberID
AND T.Active = 0
AND LEFT(a.hramadAnswer, 3) = 'Yes' AND LTRIM(RTRIM(SUBSTRING(a.hramadAnswer, 5, LEN(a.hramadAnswer)))) != '' and Member.ClientID = @ClientID and Member.MemberID = @MemberID ORDER BY ServiceDate DESC