Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I am having some issues in SQL SP.
I am having a table like this with the name Master.

EmpID Name Mode Normal_ot Dayoff_ot
1 aaa absent 0 0
2 bbb Present 0 1
3 ccc Present 1 0
2 bbb Present 2 0

from this i need to generate a report with these fileds

EmpID Name ttl_Absent tt_Present Normal_ot Dayoff_ot
1 aaa 1 0 2 1
2 bbb 0 2 2 1
3 ccc 0 1 1 0

for this how can i write the SP or is there any other ways to generate report other than creating an Stored Procedure. I'm using crystal report to generate the report, so am i can generate this report with crystal report formulas.

Also using the c# windows form in the front end.

Please any one can help me in this case

Thanks in Advance...
Posted

1 solution

by using this Case When[^] and Group By with Sum Function [^] you can achieve the solution.
try your self first, if you are not then tell me i will do that.
 
Share this answer
 
Comments
ruzan hizar 28-Jun-11 4:57am    
OK Thanks ,
First i'll try and if i can not i'll let you know.

Thanks for your help ..

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