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
Solved

Rotated Shifts

Posted on 2014-02-17
1
90 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 50

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Import Data from Multiple Text Files in Excel 12 58
Visual studio 2015 1 21
Trying to filter a sub-report 9 27
Access join syntax when converting to T-SQL query 4 32
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

789 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