I am trying to create a cross-tab report to show progress of Data Enrichment on a Vendors spreadsheet which is imported into SQL via SSIS. The data is
date_added stat-Desc stat_value
2020-01-27 Address 1 - missing items 267
2020-01-27 Bank Account - Invalid Items 46
2020-01-31 Address 1 - missing items 201
2020-01-31 Bank Account - Invalid Items 42
What I would like to produce is a report as follows:
stat-Desc 2020-01-27 2020-01-31
Address 1 - missing items 267 201
Bank Account - Invalid Items 46 42
etc
Any ideas? I have tried a PIVOT query but keep getting dates instead of stat values, but everything else was ok
Awesome! Thanks Yosiasz - ran the second script as is and looks very good.
An "expert" colleague said pivoting the date cols dynamically was impossible but I absolutely knew that if MS Access could do it, so can SQL!
Will test on "real" data.
PS. How's the Bank Roberry going?