Results 1 to 4 of 4
  1. #1
    goestejs is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    7

    Table Relationships

    I work in a manufacturing facility and I am creating a database to track Production Downtime. We have several assembly lines working 3 shifts each day. I have the following table to record the Daily Production where the date, line and shift are the primary key in order to avoid duplication of data:

    tblProduction:
    ProductionDate (PKey)
    LineID (PKey)
    ShiftID (PKey)
    ShiftLength
    QtyProduced
    QtyScrapped


    QtyReworked

    I have another table to record the Daily Downtime which could be for a number of different reasons:

    tblDowntime:
    DowntimeID (PKey-Autonum)
    DowntimeReasonID
    DowntimeMinutes

    The problem is I am not sure what foreign key I should use in tblDowntime in order to create the relationship with tblProduction. Any ideas?

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I did find any relation between your two tables where you can create relationship.

    if you want relationship, you need to add fields ProductionDate ,LineID (PKey),ShiftID to the second table.

    The point is, first you need to decide what you goal is, then decide how to design the tables. Not in the way that you create two tables first then think about what can you do with the two tables.

  3. #3
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    goe,

    weekend is correct in that you have nowhere to issue a relationship. I would suggest thinking about what you want to report. EXACTLY. for example, if your supervisor wants the amount of downtime and at what times they occurred, you need no relationship (and in fact, only ONE table).

    your one piece of data that is of concern to you is the DOWNTIME. since that is the case, you really don't need any relationships. you would however need some, if for example your supervisor is concerned with other stuff, like employees during a certain shift, multiple factories, etc, etc...

    relationships are used to connect GROUPS of data.


    e.g. - employees, factories, downtimes, lines in ONE factory, products produced.

  4. #4
    goestejs is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    7
    Thanks for your responses. My issue was solved by creating a composite index for ProductionDate, LineID & ShiftID and then adding an AutoNum field as my Primary Key in tblProduction and using it as the Foreign Key in tblDowntime.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Table Setup and Relationships
    By CoachBarker in forum Database Design
    Replies: 5
    Last Post: 08-16-2010, 09:04 AM
  2. Table Relationships
    By seanp in forum Access
    Replies: 2
    Last Post: 04-15-2010, 07:12 AM
  3. Table Relationships?
    By Meld51 in forum Access
    Replies: 3
    Last Post: 03-01-2010, 08:34 AM
  4. Table Design & Relationships
    By mastromb in forum Database Design
    Replies: 16
    Last Post: 12-30-2009, 10:35 PM
  5. Table Relationships
    By jp2access in forum Database Design
    Replies: 3
    Last Post: 06-19-2009, 10:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums