General information
Forum:
Microsoft SQL Server
Title:
How 2 automatically calculate % complete??
Hi friends
I've 2 tables.assignment(pk) and worktime(fk)
assignment has fields like
staffid,estimatedduration,status(i.e how much % an assignemt completed),assid
worktime table has
starttime,stoptime,fk_assid
everytime a staff starts new worktime an entry will be created in worktime.
my question is,
how can automatically update the percentage complete(i.e status field). say Allocate 2 days, spend 1 day and the % figure would be 35. Allocate 2 days spend two days and the % figure would be 70.(when this assignment tested then it is 100% but for the time being i've to update upto 70% only) .
Can u guys guide me how can i achiev this
sample data..
staff table
----
assid, staffid,estimatedduration,status(i.e how much % an assignemt completed)
381 ellen 1d 35(rough figures)
382 karl 12h 75
383 RAJ 6min 60
wortime table
-----
fk_assid,starttime,stoptime
381 2003-12-03 10:53:00.000 2003-12-03 13:49:00.000
381 2003-12-03 12:12:00.000 2003-12-03 13:49:00.000
381 2003-12-03 10:29:00.000 2003-12-03 13:49:00.000
381 2003-12-03 10:44:00.000 2003-12-03 13:49:00.000
381 2003-12-03 10:32:00.000 2003-12-03 13:49:00.000
381 2003-12-03 10:27:00.000 2003-12-03 13:49:00.000
381 2003-12-03 13:49:00.000 2003-12-03 13:49:42.640
381 2003-12-03 10:51:00.000 2003-12-03 13:49:00.000
381 2003-12-03 13:51:00.000 2003-12-03 13:51:26.467
381 2003-12-03 10:52:00.000 2003-12-03 13:49:00.000
381 2003-12-03 10:45:00.000 2003-12-03 13:49:00.000
382 2003-12-03 16:21:00.000 2003-12-03 16:21:00.000
382 2003-12-03 16:20:00.000 2003-12-03 16:21:00.000
383 2003-12-05 16:51:00.000 2003-12-12 16:40:23.550
383 2003-12-05 16:50:00.000 2003-12-05 16:51:00.000
many thanks for ur ideas :-)
---------
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only