Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 need help to get the report

Author  Topic 

AAAAA
Starting Member

1 Post

Posted - 2012-08-14 : 16:23:56
I want to make a report that can give me the total number of hours worked by the employees in the department in this manner.

Sub Departments--->
Departments 1 2 3 4 5 ........ so on
1 23 33 32 45 .. so on
2
3
|
|

I have the department table, Schedule table and Employee table but I need help in writing the query to generate the working hours of that sub-dept in that particular dept.
The dept table also has the parent id which indicates the parent node for other sub department
I need help in getting an idea to write a query, pls help,thnx

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-14 : 16:51:02
have a look at PIVOT syntax in books online

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -