Table stucture questions

K3vin

New Member
Joined
Jun 23, 2017
Messages
3
Hi,

I am building a planning database that will hold staff tables, holidays, sickness, requests so that worked days can be planned.

Just wanting to know if this structures is going in the right direction and should holidays and absence be in the same table with other table with ID of these types?

tblStaffing IDtblHolidaysPlanningTeamIDtblShiftstblRequestDetails
ForenameHolidayIDPlanningIDShiftPatternIDRequestID
SurnameStaffIDPlanningIDPlanningID
EmploymentCategoryPlanningIDStaffIDStaffID
HubLeaveTypeStartShiftStartDate
DepartmentStartDateEndShiftEndDate
FTEEndDateStartTime
SupervisorIDApproved/DeclinedEndTime
CostCentreActivity
LatestStartDateComments
MondayHours
TuesdayHours
WednesdayHours
ThursdayHours
FridayHours

<tbody>
</tbody><colgroup><col><col><col><col><col><col><col><col></colgroup>






My other question is format of the shift pattern


StaffIDMondayTuesdayWednesday-
5777-
9707-

<tbody>
</tbody>

or should it be
StaffIDDateDayHoursworked
523/06/2017Friday7
916/06/2017Monday7

<tbody>
</tbody>
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Welcome to the Board!

Thinking from a Data Normalization perspective, I would do the following:

1. Your Staffing table should have a unique staff ID field. Names are never good to use, as two people can have the same name.

2. The five "hours" fields should probably be moved out of your Staffing table and into its own table, i.e.

tblStaffingHours
StaffID
DayOfWeek
StartTime
EndTime

3. Regarding your shift pattern question, go with the later option you displayed.
 
Last edited:
Upvote 0
Thanks I have went with your advice got most of the tables built.

The table relation between the tbemployees and the tblTimeCard

am struggling a bit with linking the following 3 tables.

One table has the employees, one with the shift pattern days worked and length of shift then there is the actually time card with what they actually worked each day.

There will be more than one staffID in each of these tables for the timecard and shift pattern so how to I create a unique reference or primary key in these tables.

should I join the autonumber with the staffID to create a primary key or is this going down the wrong path.

tbEmployess
StaffID
SupervisorID
Last Name
First Name

tblStaffHours
StaffID
Workday
Hours

tblTimeCardID
ShiftID
StaffID
StartShift
EndShift
<colgroup><col width="97" style="width: 73pt; mso-width-source: userset; mso-width-alt: 3547;"> <tbody> </tbody>
<colgroup><col width="172" style="width: 129pt; mso-width-source: userset; mso-width-alt: 6290;"> <tbody> </tbody>
 
Upvote 0
The relationship between the StaffID and the other two tables will probably be one-to-many, which is OK.
You should have Primary Keys in your other tables. There are a few ways of going about this:
- Using a "Joint" Primary key field (i.e. "StaffID" and "Workday" together make a unique record)
- Create another ID field
- Add an Autonumber field to the table

There really is no one correct way of doing it; people have different preferences.
To see various discussions regarding the benefits of doing it different ways, read these:
https://www.access-programmers.co.uk/forums/showthread.php?t=182610
https://www.access-programmers.co.uk/forums/showthread.php?t=89864
 
Upvote 0
Am still not getting this join on the table between the staffhours and timecard tables

If I use autonumber only how do I bring back the Staffhours ID from the table

This is sample of the data

StaffHoursIDStaffIDOwnerIDWorkDayHours
1SL600SL200Monday7
2SL600SL200Tuesday7
3SL600SL200Wednesday7
4SL600SL200Thursday7
5SL600SL200Friday7
6SL1000SL200Monday7
7SL1000SL200Tuesday7
8SL1000SL200Wednesday7
9SL1000SL200Thursday7
10SL1000SL200Friday7
TimeCardIDStaffHoursIDStaffIDShiftStartShiftEnd
1SL60026/06/2017 08:0026/06/2017 16:00
2SL60027/06/2017 08:0027/06/2017 16:00
3SL60028/06/2017 08:0028/06/2017 16:00
4SL60029/06/2017 08:0029/06/2017 16:00
5SL60030/06/2017 08:0030/06/2017 16:00
6SL100026/06/2017 08:0026/06/2017 16:00
7SL100027/06/2017 08:0027/06/2017 16:00
8SL100028/06/2017 08:0028/06/2017 16:00
9SL100029/06/2017 08:0029/06/2017 16:00
10SL100030/06/2017 08:0030/06/2017 16:00

<tbody>
</tbody><colgroup><col><col><col><col><col></colgroup>
 
Upvote 0
What do you want to bring back from these tables? You've also got me a little lost because in one post you talk about employees, and in another staff ... which is it? Also now a lot of table names have been thrown out so not sure what tables you are actually using now.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top