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
 Sum hours spent when resource name and task id rep

Author  Topic 

walkman
Starting Member

2 Posts

Posted - 2010-04-25 : 14:50:24
Hi -

I am new to SQL and need your help sorting this query out. Here is what i am trying to do. I have set up a datalist on the sharepoint team site. Every resource in my team is required to fill in their utilization data, detailing the number of hours they spent working on a task. Sample data below,

Name Task Effort Date
Res1 1234 5 04/01/2010 --Res1 spent 5 hours on WorkItem 1234
Res2 1234 4 04/01/2010 --Res2 spent 4 hours on WorkItem 1234
Res1 1234 2 04/02/2010 --Res1 spend 2 hours on WorkItem 1234

Now if i wanted to write a query that would give me the following result, how would i do so?

Res1 1234 7 -- Total time spent by a resource on a specific task

Any inputs appreciated. Thank. T.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-25 : 14:53:45
[code]SELECT Name,Task,SUM(Effort) AS TotalEffort
FROM Table
GROUP BY Name,Task
[/code]

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

Go to Top of Page

walkman
Starting Member

2 Posts

Posted - 2010-04-25 : 15:07:38
Thank you my friend. That perfectly solves my query :)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-26 : 00:23:04
welcome

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

Go to Top of Page
   

- Advertisement -