Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hellow gurus, Please assist,
I have the following data in a view in MS SQL:

TypeID TypeName Amount
1 Mr 10.00
1 Mr 12.50
1 Mr 5.30
2 Mrs 10.00
2 Mrs 12.20
2 Mrs 5.00
2 Mrs 2.60
3 Ms 15.20


What I want to have Crystal reports to display is "The sum of the Amounts for a particular Type together with the TypeID and the TypeName".
So from the above e.g. I want to have the data displayed as follows:

TypeID TypeName Amount
1 Mr 27.80
2 Mrs 29.80
3 Ms 15.20

I have all my codings to display the reports done and the reports are showing as anticipated. I just need assistance on the above.

Thanks in advance
Posted

1 solution

One way to go about this is to simply write your SQL to extract the data in the format you want, then display that on your Crystal Report.

eg:
SQL
select TypeID, TypeName, Sum(Amount) as TotalAmount 
from VIEWNAME 
group by TypeID, TypeName 
order by TypeID, TypeName
 
Share this answer
 
Comments
ekipongi 2-Oct-13 21:32pm    
Thanks _Damian S_

It worked as I wanted.
thatraja 3-Oct-13 5:01am    
5!

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