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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 auto count for different level of task

Author  Topic 

aizam
Starting Member

1 Post

Posted - 2012-07-31 : 23:36:34
i have table like this

[ProjectID], [TaskName] ,[%Status], [ID],[TaskB4]
* taskb4 is refer to the above task
and the data is look like this

1, Pre Implementation, 20, 1, NULL
2, Implementation, 0, 1, NULL
3, Indentify Requirement, 80, 1, 1
4, Project Proposal, 50, 1, 1
5, Server Requirement, 100, 1, 3
6, Software Requirement, 80, 1, 3
7, Stakeholder Requirement, 60, 1, 3

so the task table will continue to multiple level (depend what user enter)

the problem is..i want to calculate average to update the top level when end user update the last level of the task...
for above example..
when user update one of task(5 or 6 or 7)
it will calculate average and update the [%Status] on task ID 3
and this value will combine with [%Status] on task ID 4 to calcluate average for [%Status] on task ID 1. this loop will continue until the top level where taskb4=NULL..

that all. thanks in advance,

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-01 : 02:16:02
see

http://msdn.microsoft.com/en-us/library/ms186243(v=sql.105).aspx

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

Go to Top of Page
   

- Advertisement -