Hi,
I have a result set returned from a stored procedure that has always has the same no. of rows and colummns. I use this stored procedure for two reports, but one of them needs the results transposed.
For example
and I need to display this as
I thought I would be able to use the cross-tab, but it doesn't seem to be able to manage it. The formatting is all messed up and it produces unintelligible results with complex nesting. It seems to work fine if there is only one column and row to be transposed, but not for the situation I've described above.
Any ideas on how to do what I require, or even if it is possible?
Any help would be much appreciated.
I have a result set returned from a stored procedure that has always has the same no. of rows and colummns. I use this stored procedure for two reports, but one of them needs the results transposed.
For example
Code:
+---------+-------+-----+-----+
| Band | Count | Avg | Min |
+---------+-------+-----+-----+
| 0 - 30 | 10 | 5 | 0 |
| 30 - 60 | 15 | 35 | 32 |
| 60 - 90 | 12 | 64 | 63 |
| 90+ | 5 | 109 | 94 |
+---------+-------+-----+-----+
| Totals | xx | xx | xx |
+---------+-------+-----+-----+
and I need to display this as
Code:
+---------+--------+---------+---------+-----+--------+
| Band | 0 - 30 | 30 - 60 | 60 - 90 | 90+ | Totals |
+---------+--------+---------+---------+-----+--------+
| Count | 10 | 15 | 35 | 5 | xxx |
| Avg | 5 | 35 | 64 | 109 | xxx |
| Min | 0 | 32 | 63 | 94 | xxx |
+---------+--------+---------+---------+-----+--------+
I thought I would be able to use the cross-tab, but it doesn't seem to be able to manage it. The formatting is all messed up and it produces unintelligible results with complex nesting. It seems to work fine if there is only one column and row to be transposed, but not for the situation I've described above.
Any ideas on how to do what I require, or even if it is possible?
Any help would be much appreciated.