Quantcast
Channel: SQL Server Reporting Services
Viewing all articles
Browse latest Browse all 1418

How to implement a stored procedure to get this summary result?

$
0
0

I will implement a SSRS summary data report with following data records from one table.

ID         Part                  Type                 Value

1          Payroll              State Tax           2010

1          Payroll              City Tax            500

1          Payroll              Medical             300

2          Payroll              State Tax           2000

2          Payroll              City Tax             400

3          Payroll              FICA                  200

1          Refund              State Tax           -500

1          Refund              Medical             -100

3          Payroll              FICA                  200

1          Refund              State Tax           -500

1          Refund              Medical             -100

How Do I implement a sql stored procedure to produce following result by summarizing Type for each Part so it is easy to build the ssrs report? Thanks a lot!

Type                      Payroll                  Refund                 Total

State Tax              4010                      -500                       3600

City Tax                 900                        0                            900

FICA                       400                         0                          400

Medical                300                         -100                       200


Viewing all articles
Browse latest Browse all 1418


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>