I've been reading the various examples on this board but haven't been able to whip up a dynamic pivot query to fit my code. Any help would be appreciated!
I have two tables
AuxDef
Fieldnumber Fieldlabel
------------------------
1 Buyer
2 Size Range
3 Source
4 Country
5 Vendor
ect... ect...
AuxFields
PageID FieldNumber TextValue
-----------------------------------
1 1 Sam
1 2 S-L
1 3 Domestic
1 4 Canada
2 1 Kyla
2 3 Import
2 5 VendorName
2 6 Off-Shore
2 7 Fit 1
2 8 Yes
4 1 Sara
4 3 Import
4 4 China
ect.. ect.. ect..
What I would like to do is create a dynamic pivot that joins the two tables by fieldnumber and uses the fieldlabels as the column headers after pageid. It would look similar to this.
PageID Buyer Size Range Source Country Vendor Type Status Exclusive ect..
------------------------------------------------------------------------------------------------
1 Sam S-L Domestic Canada
2 Kyla Import VendorName Off-Shore Fit 1 Yes
4 Sara Import China
I've tried examples on this site but I keep running into errors either when I replace the fields with my own or in the actual column generation.