views:

58

answers:

2

It's a little complex. I'll try to be as clear as I can.

It's a work plan. We make estimation of the total time needed for a task, say 100 hours, and break it into periods of month. For example, 30 hours should be done in March, 20 hours in April, and 50 hours in May. After every month, the plan can be changed. I need to keep both the updated version and historical versions of the plan in DB, to see the trend and predict the future.

The sum of remaining hours of each task is important (to draw breakdown chart, you might already see that we're using scrum model). I'm not sure how to design it to be most flexible. And I plan to use Access 2003. I'm a little worrried about the performance, if the record number grows too fast.

Is there any suggestion for me? Thanks a lot.

A: 

I would design this with each set of monthly predictions handled as a group of rows. To support historical data add a "date created" field. So something like (this is T-SQL syntax, I gave up on Access a long time ago):

CREATE TABLE dbo.TaskEstimates
(
    DateCreated         datetime    NOT NULL,
    EstimateYearMonth   datetime    NOT NULL,
    HoursRequired       decimal     NOT NULL,

    CONSTRAINT PK_TaskEstimates PRIMARY KEY CLUSTERED
    (
        DateCreated     ASC,
        EstimateMonth   ASC
    )
);

The DateCreated field would be the same for all members of an estimate set entered today, for example. The EstimateYearMonth field contains just the year and month (day = 1, time portion = 0:00:00.000).

Combinations of aggregate functions and grouping criteria then allow retrieval of any combination of data you need.

In addition to, or instead of the DateCreated field you could also use a GroupID that is incremented for each set. So the first set all has GroupID == 1, the next set == 2, and so on. This might be easier for historical selection if you're asked counted-query questions instead of dated-query questions; e.g. "give me the 3rd cycle estimates" instead of "give me the estimates done in June".

BTW, I normally use datetime for all date and time related data, instead of separating it into year, month, etc. so I only need to normalize a few selection criteria instead of fiddling around with type conversions for each row.

devstuff
Thank you for attention. I think one more field is needed - `TaskID`. BTW, do you know whether the performance will be OK if this table has over 100K records in Access?
phoenies
This is actually compressing 3-dimensional (task id, month, and created date) data into 1-dimension. No wonder the record number is so big.
phoenies
YMMV. I would seriously suggest using SQL Server instead (Express edition would do it without any problems). Access is really a relic now.
devstuff
@phoenies, I don't get what you mean by "record number is so big". But if you're worried about the size of each row, then a multi-field primary key is exactly what you need here. Sure, you can use smaller data types, but in the end you're swapping a few bytes of disk space for CPU cycles during type conversion.
devstuff
Yes, I'll use SQL Server. Access can't be counted on.
phoenies
A: 
TaskMaster
   tid
   datecreated
   estimatehours

TaskBreak
   tid
   dateupdate
   month
   hours

here, in TaskBreak (tid,dateupdate) is primary key. When you update your task hours make a new entry in TaskBreak table. So this way you will have both updated versions and original version of task.
If you are updating task plan once only in a month then you can store just month and year in dateupdate column of TaskBreak table.

Himadri
Thank you. The design of `TaskBreak` is similar to devstuff's. The problem is in this way the record number grows huge. As I mentioned in comment for devstuff's answer, there may be 10K records in current stage. I'm worried about Access' performance. What do you think if I name a field after every task, and add one field if another task is added? Or maybe name fields after created dates? Is it a crazy idea?
phoenies
In this way, the `tid` or `dateupdate` can be eliminated, and 1-dimensional data become 2-dimensional. Am I clear enough?
phoenies
@phoenies I didn't get what you say. You want to add a field for each task and how you will manage updated hours for all months? What will be table design?
Himadri
TaskBreak dateupdate month hours Task1 Taks2 Task3 ... Thus I'd have to add a column to add another task, yet it compresses several rows into one, therefore making row number smaller. What do you think?
phoenies
@phoenies In this case suppose Task1 is distributed in 3 months and task2 is in 4 months and Task 3 is in 10 months then some fields will remain empty.. I don't think it is a feasible way..but I don't know why?!!
Himadri
Oh, absolutely! How could I not realize that! I agree it's not feasible, and it's the same if I change Task1 Taks2 Task3 ... to dateupdate1, dateupdate2, dateupdate3, ... Thank you!
phoenies