Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

CODE	EMP_OP	E1	E2
1	200000	2000	2000
1	377209	2371	2134
2	190159	2248	2024
2	254707	0	1848
3	969704	5000	5000


I am using Crystal Report.
I want result like below.

CODE	EMP_OP	EmpContribution(E1+E2)	
1	577209	8505	
2	444866	6120	
3	969704	10000


I am fresher.Can anybody please help me. Any help will be highly acceptable.Thanks in advance.
Posted
Updated 28-Dec-14 19:59pm
v2

1 solution

Define below query as a source of Crystal Report:
SQL
SELECT CODE, SUM(EMP_OP) AS EMP_OP, SUM(E1) + SUM(E2) AS EmpContribution
FROM TableName
GROUP BY CODE


For further information, please see:
Use SQL commands to solve report problems and speed Crystal Reports[^]
Understanding Query Types[^]
 
Share this answer
 
Comments
CPallini 29-Dec-14 2:12am    
5.
Maciej Los 29-Dec-14 2:13am    
Thank you, Carlo ;)

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