?
Solved

Rotated Shifts

Posted on 2014-02-17
1
Medium Priority
?
94 Views
Last Modified: 2014-08-11
I need to build function that can created rotated shifts for 4 staff, that can be rotated every two days

Rules:
scenario

3 shifts (7-3,3-11,11-7)

1.7-3
2.3-11
3.11-7
                Day1          Day 2       Day 3   Day 4   Day 5  Day 7  Day 8   Day 9
Team 1     1                 1              2          2         3          3       off        Off
Team 2     2                 2             3           3         off    off          1            1
Team 3      3                 3             off        off       1        1           2            2
Team 4      off               off            1         1          2         2           3           3


But we need to configure for each one what is his last shift (1 or 2 o r 3) before calculate because the current can be one of them
We should configure the start date when this should be apply
lets say the day 1 is 2/3/2014  then day 2 will be 3/3/2014
No vacations.
The second we need to save this in database and exported as excel sheet
0
Comment
Question by:abdallah1973
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 39864514
HI,

the function could be this (the adjustment deüpends on the start date)

Function FindTurns(ByVal myDate As Date, ByVal TeamNr As Integer) As Integer
' 0 = 7-3, 1 = 3-11, 2 = 11-7, 3 = Off
' TeamNr = 1 to 4
Adjust = 2
FindTurns = ((((((myDate + Adjust) Mod 8) \ 2) + 1) Mod 4) + TeamNr - 1) Mod 4
End Function

Open in new window

Regards
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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