Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-server-2005 SQL , +
Dear,
 
I am building a report using report builder 2.
let say the data from my query is look like below:
 
 Select membershipid,billamount,transactionAmount 
 From  membership m inner join bill b on b.membershipid=m.id
 left outer join transaction t on t.billId=b.id
MembershipId(membership Table) billAmount(bill)  TransactionAmount (transaction)
1                              100                   20
1                              100                   20
1                              100                   50
1                              100                   10
2                              50                    10
2                              50                    10 
2                              50                    20
 
when I used the row group in report builder on membershipId then add Total group
,report output is like this:
 1                             400                  100
 2                             150                  50
 
I want to see this output:
 1                             100                  100
 2                             50                   50
 

why this happen?and What should I do؟
Posted 13-Sep-12 21:02pm
Edited 14-Sep-12 10:07am
Maciej Los134.5K
v2
Comments
Kuthuparakkal at 14-Sep-12 3:07am
   
Can you fix it in your Query ?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The only way to achieve that is to change a query:
SELECT membershipid, billamount, SUM(transactionAmount) AS transactionAmount
FROM  membership m inner join bill b on b.membershipid=m.id
left outer join transaction t on t.billId=b.id
GROUP BY membershipid, billamount
ORDER BY membershipid, billamount
and remove groupping in the report.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 18 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100