Hi everyone.
I have the following table:
tbl_LabResults
Result_ID
Result_Date
Patient_ID
LabTest_ID
LabTest_Units
LabTest_Value
1 Date_1 Pt1 Test1 yyyy 6,7 2 Date_2 Pt2 Test2 xxxx 8,5 3 Date_3 Pt1 Test2 xxxx 4,4 4 Date_2 Pt3 Test3 zzzz 3,2
What I would like to do is to transform it like that:
Result_ID Patient_ID LabTest_ID LabTest_Units Date_1 Date_2 Date_3 1 Pt1 Test1 yyyy 6,7 2 Pt2 Test2 xxxx 8,5 3 Pt1 Test2 xxxx 4,4 4 Pt3 Test3 zzzz 3,2
By searching a little, I understand that I should use a normalizing UNION ALL query and a TRANSFORM query, probably with First, or something like that.
I have tried to make it work, with no success.
Could anyone help ?