automatically calculate % complete??

  • Next what does 1 day represent? 24hrs? And are you just taking the sum of time for all start and stop times to calculate the values? Your comments and sample leave me confused.

  • First off what version of SQL are you using?
    --sql server 2000 dev edition
     
    Next what does 1 day represent?
    --8hours
     
    And are you just taking the sum of time for all start and stop times to calculate the values?

    --Yes

     
    Thanks antares686
     
     
  • Ok this is where you confuse me.

    "Allocate 2 days spend two days and the % figure would be 70."

    If a allocate 2 and spend 2 days then how am I getting 70%?

  • Ok, first thing I know I would do thou at this point is factor down to a common element on the estimatedduration column.

    Since so far your smallest unit is 6 min (or mintues to be precise) store all values as number of minutes.

    1 day or 8 hrs = 60 * 8 or 480 min

    12 hrs = 60 * 12 or 720 min

    and store a visual rep in another field sayign whether to convert to visual for hours days or mintues.

    This way you have a common element of work units.

     

    Then you should be able to SUM all the differences in mintues between start and stop times grouped by assid. Which then you can compare for calcualtion for the percentage.

    I think IMHO you are over complicating things with the mixed values in the one column.

  • Then it would be a simple matter of a trigger each time the value is updated. Or better get rid of the column and make a view with that column calculated.

  • actually it becomes 100 when this assignment tested.
    ok ,to make things easier we'll say

    "Allocate 2 days spend two days and the % figure would be 100"

    "Allocate 2 days, spend 1 day and the % figure would be 50."

    hope i am clear now

Viewing 6 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply