Solved

Rotated Shifts

Posted on 2014-02-17
1
86 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 49

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

823 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