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.
| 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 DateRes1 1234 5 04/01/2010 --Res1 spent 5 hours on WorkItem 1234Res2 1234 4 04/01/2010 --Res2 spent 4 hours on WorkItem 1234Res1 1234 2 04/02/2010 --Res1 spend 2 hours on WorkItem 1234Now 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 taskAny 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 TotalEffortFROM TableGROUP BY Name,Task[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
walkman
Starting Member
2 Posts |
Posted - 2010-04-25 : 15:07:38
|
| Thank you my friend. That perfectly solves my query :) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-26 : 00:23:04
|
| welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|