Hi All,
I basically need help with the following staffing issue in connection with our Annual leave “ROSTERS”. What we have at our work presently is, …. Here goes; Presently staff are allocated a Leave Letter such as A,B, D, E, F, G etc. These letters correspond to 6 week blocks within each calendar year, the allocated letter will remain with you throughout your employment although it does roll over to the following block each year. So for obvious reasons this doesn’t suit every member of staff, so our HR dep’t came up with the idea that if we could find another staff member willing to swap you in a three or six week blocks (in other words only 1st 3wks or last 3 wks of the block, or all 6wks) then they would be happy to accommodate both parties. This solution work reasonably well, but is obviously flawed as some staff will lose out.
E.g. take the following scenario:
If “A” wants “C”, and “B” wants “A”, “C” wants “B”.
“A” who wants “C” loses out , as the person with “C” is not interested in taking “A” as he wants “B”.
But if all three got together, they could all swap at the same time ( 3-way swap) and then everyone is happy, now the thing is we need a register or DB’s to cope with the calculation. As if that’s not enough of a problem, to make matters complicated even further (syntactically), the bigger the amount of staff involved in a 3, 4, 5, 6 way swap; then the greater amount of people that will be accommodated and in turn will be happy with it.
So let’s say we have a db with a table for the names, letters and date ranges sought after and another table with all leave letters names and date ranges offered.
Then a syntax solution possibly using Dcount to look for duplicates matches based on date range value’s >= & =< and also would be looking for max value of exact matches (based on date ranges, in the haves column to the wanted column, then arrange the returned values with staff names and then send to a make table and or print out results to some sort report of who swaps with who. The following register would make 5 X members of staff happy if they get together ( if you can spot the pattern)
Have Letter Date range Sought letter Date Range Swap X5 Staff 1 A <Some dates> B <Some other> Staff 1 <> 2 Staff 2 B “” C “” Staff 2 <> 3 Staff 3 C “” D “” Staff 3 <> 4 Staff 4 D “” E “” Staff 4 <>5 Staff 5 E “” F “” Staff 5 <> 6 Staff 6 F “” A “” Staff 6 <> 1 Staff 7 G “” G “” Staff 7 > ???
Any help or thoughts appreciated