A web application which allows users to create their own health questionnaire forms, each form in turns allows the user to customize the form and add as many input fields as needed for questions and answers. Now these results are stored in two tables
tblTransaction:
ID Person Date FormName
-------------------------------------------
1 John Smith 19/09/2017 FamilyHistory
2 Pat White 18/07/2017 FamilyHistory
2 Pat White 18/07/2017 Diabetes
tblContent:
ID TranID FieldName Value
--------------------------------------------
1 1 Do you smoke Yes
2 1 How many a day 30
3 2 Cancer in the family No
4 2 Blood pressure No
I need to create an extraction per Date, Person, FormName and then list each unique FieldName found per FormName as a separate coloumn, taking into account that the count and value of FieldName is not known.
This is what the result should look like.
Date Person FormName Do you smoke How many a day
----------------------------------------------------------------------
19/09/2017 John Smith FamilyHistory Y 30