I'm working on a project which needs to export a report from SQL
query using SSRS
.
The data come from query result (about needs of computer types in each school).
School | product | specs | Amount |
---|---|---|---|
Standford | Desktop | spec1 | 1 |
Standford | Desktop | spec2 | 2 |
MIT | Desktop | spec1 | 3 |
Georgia Tech | Desktop | spec2 | 4 |
Standford | Laptop | spec3 | 5 |
Standford | Laptop | spec2 | 6 |
MIT | Laptop | spec1 | 7 |
Georgia Tech | Laptop | spec3 | 8 |
The report we need:
Report on Desktop needs
School | spec1 | spec2 |
---|---|---|
Standford | 1 | 2 |
MIT | 3 | 0 |
Georgia Tech | 0 | 4 |
Report on Laptop needs
School | spec1 | spec2 | spec3 |
---|---|---|---|
Standford | 0 | 6 | 5 |
MIT | 7 | 0 | 0 |
Georgia Tech | 0 | 0 | 8 |
Currently, I am just able to create a report which the 2 tables
are merged into 1
, but I need them to be separated.
Is this possible in SSRS
, or is there any other way with SQL
query?
Thank you
CodePudding user response:
If the GIF below runs too fast, then save it and open it in an image editor so you can step thru it.