Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Allocating users to days

Author  Topic 

evvo
Starting Member

16 Posts

Posted - 2008-07-30 : 09:59:15
im working on a system that allocates users for cover on days over a year.

now im currently allocating users on all days by alphabetically assigning them. (theres holiday periods to consider too)

however saturday in particular needs to be evenly split but due to hols variation i have found the split not to be even, a few are doing 4 and 1, majority 3, rest doing 2 - whereas all should be allocated 2 OR 3 in this instance. the few doing 4 are early in the alphabet so i can see they are getting first assignment to the remainder.

what would be a good way to code this to ensure the 200 saturdays are split as evenly as possible by 80 users?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-30 : 10:02:39
May be check before each allocation number of saturdays allocated already to each users and picking up ones with minimum ones assigned and taking alphabetically first one in case of ties.
Go to Top of Page
   

- Advertisement -