I have a dynamic number of fields and want to use a pass-through query (Pivot function) to grab pivoted data.
Table structure:
Client Person DataField DataValue
ABC 123 Name John
ABC 123 Age 23
ABC 456 Name Jane
ABC 456 Age 25
XYZ 123 Name John
XYZ 123 Age 23
What I want the query to return (for client ABC only):
Person Name Age
123 John 23
456 Jane 25
Note that the # of datafields (columns) could change.
Struggling with Pivot syntax. Thanks for any help!
Table structure:
Client Person DataField DataValue
ABC 123 Name John
ABC 123 Age 23
ABC 456 Name Jane
ABC 456 Age 25
XYZ 123 Name John
XYZ 123 Age 23
What I want the query to return (for client ABC only):
Person Name Age
123 John 23
456 Jane 25
Note that the # of datafields (columns) could change.
Struggling with Pivot syntax. Thanks for any help!