Board index » delphi » Database format help

Database format help

I have written an applicatiion that tracks service history for my
company. Tracks Maintenance agreements, equipment names, model numbers,
customer info ect.
All was well until I thought it would be nice to be able to assign
monthly maintenance tasks to all the equipment we manitain.
Right now each piece of equipment is in a table the key field being a
auto inc number, then secondary are equipment code, and customer number.
I would like to be able to have numerous maintenance tasks for each
piece of equipment:

                                      Clean filter
                                      Change belt
                                       Change oil
 so forth and so on.
Some pieces of equipment might have 100 tasks, and there are approx 45
different types of equipment.
Half of the tasks are common to all pieces of equipment, so it would
make sense to have a table of just tasks.
Then I would like the Service manager to be able to go in and assign the
tasks for a piece of equipment and assign what month they will be
perfrormed.
Then this information could be printed off by month and handed out to
the technicians.

Does anyone have an idea on how to do this.
thanks chris

 

Re:Database format help


What you have is a many-to-many relationship between the equipment and task
tabels. One piece of equipment can have many tasks and one task can be
assigned to many pieces of equipment. Relational databases do not handle
this well. What you need is a linking table with two fields, both of which
are part of the primary key. The two fields are equipment id and task id.
You add one record to this table for each task for each piece of equipment.

--
Bill Todd (TeamB)
(Questions received via email cannot be answered.)

Other Threads