I have a query that produces data on many lines due to a one to many relationship in the table design. What I have been asked to produce is a flat file with the 'many' part of the relationships as additional fields on the end of the record. They want it in Excel or CSV file.
This should maker it clearer (I hope);
Query data:
Name DOB AttendanceDate Treatment
Fred Smith 06/07/1973 01/02/09 Q23
Fred Smith 06/07/1973 01/02/09 Q24
Fred Smith 06/07/1973 01/02/09 Q25
Fred Smith 06/07/1973 01/02/09 Q26
Jimmie Jones 01/02/1945 02/02/09 S22
Jimmie Jones 01/02/1945 02/02/09 S23
What is required;
Name DOB AttendanceDate Treatment1 Treatment2 Treatment3 Treatment4
Fred Smith 06/07/1973 01/02/09 Q23 Q24 Q25 Q26
Jimmie Jones 01/02/1945 02/02/09 S22 S23
I am not sure how to do this. Can anyone help with advice, a link to something similar or code?
Thanks in advance
Jonathan
This should maker it clearer (I hope);
Query data:
Name DOB AttendanceDate Treatment
Fred Smith 06/07/1973 01/02/09 Q23
Fred Smith 06/07/1973 01/02/09 Q24
Fred Smith 06/07/1973 01/02/09 Q25
Fred Smith 06/07/1973 01/02/09 Q26
Jimmie Jones 01/02/1945 02/02/09 S22
Jimmie Jones 01/02/1945 02/02/09 S23
What is required;
Name DOB AttendanceDate Treatment1 Treatment2 Treatment3 Treatment4
Fred Smith 06/07/1973 01/02/09 Q23 Q24 Q25 Q26
Jimmie Jones 01/02/1945 02/02/09 S22 S23
I am not sure how to do this. Can anyone help with advice, a link to something similar or code?
Thanks in advance
Jonathan