A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Table design - multiple entries for a field



 
 
Thread Tools Display Modes
  #1  
Old May 21st, 2004, 04:51 PM
Carrie
external usenet poster
 
Posts: n/a
Default Table design - multiple entries for a field

Hello,

I have 3 tables - employees, performance evals, and error codes. The error codes is more of a look-up table that is indexed by a unique number. The performance eval table will contain the unique employee id and then the error code(s) for a given date. It is possible that an employee will make multiple errors on a given day - how would I capture the multiple error codes in my performance evals table? Any ideas?

Thanks,
Carrie
  #2  
Old May 22nd, 2004, 04:02 AM
DDM
external usenet poster
 
Posts: n/a
Default Table design - multiple entries for a field

Carrie, you need one more table. Let's call it, say, eval details. It will
be the junction table between performance evals and error codes, allowing
you to capture multiple errors on a given day. So:

tblEmployees
EmployeeID (PK)
....

tblPerformanceEvals
EvalID (PK)
EmployeeID (FK): One-to-many with tblEmployees.EmployeeID;
tblPerformanceEvals on the "many" side
Date

tblEvalDetails
DetailID (PK)
EvalID (FK): One-to-many with tblPerformanceEvals.EvalID; tblEvalDetails on
the "many" side
ErrorID (FK): One-to-many with tblErrors.ErrorID; tblEvalDetails on the
"many" side

tblErrors
ErrorID (PK)
....

Note that when an employee commits an error, you create a record in the
PerformanceEvals table, capturing the EmployeeID and date. Then you create a
record in the EvalDetails table, capturing the ErrorID plus any other
relevant error-related data. So you create one record in the
PerformanceEvals table for each date on which a given employee commits an
error, and one record in the EvalDetails table for each error the employee
commits on that date.

--
DDM
"DDM's Microsoft Office Tips and Tricks"
Visit us at www.ddmcomputing.com


"Carrie" wrote in message
news
Hello,

I have 3 tables - employees, performance evals, and error codes. The
error codes is more of a look-up table that is indexed by a unique number.
The performance eval table will contain the unique employee id and then the
error code(s) for a given date. It is possible that an employee will make
multiple errors on a given day - how would I capture the multiple error
codes in my performance evals table? Any ideas?

Thanks,
Carrie



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.