Solved

Rotated Shifts

Posted on 2014-02-17
1
81 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
1 Comment
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

760 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

18 Experts available now in Live!

Get 1:1 Help Now