Posted by Erland Sommarskog on 12/29/06 22:34
Jim Andersen (jba020@politiSLET.dk.invalid) writes:
> Am using robvolks crosstab-procedure to generate a crosstab query.
>
> I get this result:
> Total A B C
> juli 455 1 107 347
> okt 83 1 9 73
> aug 612 1 113 498
> juni 451 1 108 342
>
> So I get a total for each month. But I would also like a total of each
> letter
> Total A B C
> juli 455 1 107 347
> okt 83 1 9 73
> aug 612 1 113 498
> juni 451 1 108 342
> Total 1601 4 337 1260
>
> Is that possible?
You would use INSERT EXEC to capture the result from the crosstab
procedure into a temp table, and then compute a total row from the
data in it.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|