Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logic Issue

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
I am working on an employee scheduling tool. The tool works like this: the admin creates "rules" for each employee for each day. Meaning they create a rule that says by default Employee A work 8am - 5pm on Mondays. On the schedule that employee will be down for 8-5 every Monday unless the manager creates an exception (say Emp A has a Monday off) exceptions override the rules. Rules are kept in one table and exceptions in another. Rules work off the getDay()....

My problem is that I need to find a way to work in "every other" meaning an employee might work every other Monday and have the others off, or an employee might be scheduled 8-5 on Monday then 7-6 the next and so on and so on....

Any help in how I can work in this every other stuff would be appreciated... my initial thinking was to take a starting date for the every other and then go off of that but I am not sure exactly how that would work......

[conehead]
 
It seems that the rule must be "Every other ... starting on a date". Otherwise it is not well defined.
 
You can use the DateAdd function to do all sorts of things if you have fields for "start date", interval, X number

Then you could use DateAdd to see if the current date is X number of days, weekdays, weeks, months or years from the current date.

Now I will be sarcastic: As soon as you get this working expect them to come and ask how to schedule an exception for the 3rd tuesay of every month!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top