Solved

Shift Schedule database design

Posted on 2011-09-27
8
1,830 Views
Last Modified: 2012-05-12
Hi,

I have to design a generic database solution for shift schedule. Some of our clients work in a daily schedule. I mean Mon, Tue, Wed, Thur, Fri from 8 AM to 4 PM and next week from 4 PM to 12 AM. Others have a continental schedule, the employee works 3 days and is off one day.
Does anyone know if I can find a database design pattern for this type of schedule shifts?
Thanks in advance
0
Comment
Question by:ThinkerB
  • 4
  • 3
8 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 36717366
What kind of "generic" database pattern are you looking for?  What kind of data do you need to store?
0
 

Author Comment

by:ThinkerB
ID: 36717505
What I am thinking is one table that I should be able to define ShiftTypes and another one that will have shifts per user I mean based on shift type I need to be able to generate records on shift table.
The complex part is that I need to be able to define different types of shifts. Some will have fixed days and variable schedule (morning in one week and afternoon on the next one) and some users will have continental shift (3 days of work and one off).
Generic means the solution has to fit at least those two requirements.
Any ides is appreciated.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 36717893
Do you need to store the dates for each user?  Do you need to generate a work schedule for a specified period?
0
 

Author Comment

by:ThinkerB
ID: 36718641
Yes I am thinking about generate the dates and store that because I need to assign activities for that day if the user is working on the shift the activity has to occur.
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 36718692
Something like this?

User
         UserID
         FirstName
         LastName        

UserShift
         UserShiftID
         UserID
         ShiftID

Shift
         StartDate
         StartTime
         EndTime
         DayInterval
0
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 36718764
It seems like the scheduled will vary from day to day and week to week, so setting up standard schedules really won't do you any good. Based on what you're describing, I'd just set up a table with a list of the person's particular shifts, along with a notes field where you could fill anything you wanted specific to that particular shift. You'd need some kind of ID for the Employee, a Start/End Datetime (because a shift can span midnight, you'll need the whole datetime for both the start and end). Depending on how you track this data, you may also want to keep not only their scheduled times, but their actual clock in/out times as well.
0
 

Author Comment

by:ThinkerB
ID: 36933033
TheLearnedOne,

The issue with this design is that in one week that person will be on the morning shift and the next week he will be in the afternoon and I need to generate the schedule every week.
But I appreciated both ideas.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 36933711
That sounds like you need something more.  How many different combinations of shift types do you have?

If you store each combination in a ShiftType table, then you would just need to know that type, and the StartDate + DayInterval to determine the EndDate.

User
         UserID
         FirstName
         LastName        

UserShift
         UserShiftID
         StartDate
         ShiftTypeId

ShiftType
         ShiftTypeId
         Description
         StartTime
         EndTime
         DayInterval
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now