Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to get total from summed credited amount and summed debited amount in sql server 2005? For instance I am storing credited details one by one into table and same way the debited details and I WANT TO GET THE summed credited amount minus the summed debited data for several employees.
Posted
Comments
King Fisher 17-Feb-14 7:51am    
table Structure?
♥…ЯҠ…♥ 17-Feb-14 7:52am    
Try to give sample input and expected output, assuming your question you can use Group by clause to do the sum of amount on employee basis.
Rahul 105 17-Feb-14 8:37am    
For instance for many employee Ids there is credited amount of 500,200 and debited amount of 100,100 for current month and year inserted in table(odid,amt,mode(C for credit,M for debit,Created Date etc) i want to get grand amount as (500+200)-(100+100)=500 binded to my crystal report and display in report viewer in the back end

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