I am trying to generate a simple report that can be imported to excel for analysis. Currently the database documents failure causes associated with a repair. I need a "Report" that does not duplicate the failed items in the event there is more than one cause associated with the failure. some repaired items may have up to 3 causes of failure. What I would like to do is have the query show one record instead of three records (for the cases were three causes of failure were identified for a repair)
Current query format
Desired query format
I was reading about a SQL transpose call but I do not need all fields transposed (only the failure causes transposed and concatenated into one field)
Thanks for any help or resources. This has been a serious limitation for my project.
Test database attached with a query that shows the data I want to transform into the desired format.
Current query format
Code:
facilityID Failure Cause
1 Electrical Surge
1 Mechanical Wear
1 Corrosion
2 ......
2 ......
.... ......
Desired query format
Code:
FacilityID Failure Cause(s)
1 Electrical surge, Mechanical wear, Corrosion
2 .....
.... .....
Thanks for any help or resources. This has been a serious limitation for my project.
Test database attached with a query that shows the data I want to transform into the desired format.