Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi.Please help me.

My query in report builder is:
SQL
SELECT  b.MembershipId,b.Amount ,
        t.Amount AS tamount ,
        t.IncomeItemId ,
        p.Amount AS pamount
FROM    Finance.Bill b
        INNER JOIN Finance.MembershipTransaction t ON t.BillId = b.id
        LEFT OUTER  JOIN Finance.Payment p ON p.MembershipId = b.MembershipId
WHERE   b.MembershipId = 53672 AND p.CauseId IN (2,3)

where I execute this,Result is:
MembershipId  |	BilAmount |	Transactionamount |	IncomeItemId |	Payment
53672	3450000.00	2000000.00	24	2250000.00
53672	3450000.00	320000.00	28	2250000.00
53672	3450000.00	1130000.00	30	2250000.00
53672	1400000.00	1400000.00	35	0.00
53672	3450000.00	2000000.00	24	2600000.00
53672	3450000.00	320000.00	28	2600000.00
53672	3450000.00	1130000.00	30	2600000.00
53672	1400000.00	1400000.00	35	2600000.00
53672	1400000.00	1400000.00	35	2250000.00
53672	3450000.00	2000000.00	24	0.00
53672	3450000.00	320000.00	28	0.00
53672	3450000.00	1130000.00	30	0.00
53672	3450000.00	2000000.00	24	0.00
53672	3450000.00	320000.00	28	0.00
53672	3450000.00	1130000.00	30	0.00
53672	1400000.00	1400000.00	35	0.00


I am using this query in report builder.
I use Row group,but when i run my report ,result is incorrect when using sum function.
What this happen.what i do??
Posted
Updated 9-Jul-12 8:33am
v2

1 solution

Not quite clear on the question but I have a feeling you could do some good with the proper usage of a Group By[^] clause[^].
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900