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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check a database for information

Status
Not open for further replies.

santastefano

Programmer
Aug 9, 2005
54
IT
Hello
I have a routine that creates a timetable based on user input.
One session a week, start date assigned to a variable + 7 days
Two sessions a week the same but a loop that looks at both
and so on.
This works perfectly for up to seven sessions per week

I am trying to make the routine check for holidays - that is adding 7 days brings a holiday date so add 7 days and check again - if so go forward another 7 days, check again etc.

I thought a good route would be establish a table of holiday dates and use DLookUp but this is not working. I think it is neccessary to look through the entire holiday table adding 7 days each time a match is found until a match is not found but I can't make this work properly.

Any suggestions gratefully receieved, if this is not clear please tell me that I have not explained properly.
Best regards to all for 2006
 
In this thread
Date Diff excluding weekends and holidays
thread701-1170073
R937 suggests creating a full year of dates, with all holidays marked in. This may solve your problem. Using this table, you can move though in any size jumps checking if the day is flagged as a working day.

Is this the kind of thing you mean?
 
Thanks for your response, I missed the thread when searching.

I am going to try it, holidays vary by user so I will create a table and have the user input add a flag.

Here is a spec. of what I am attempting in case anybody is interested (or finds it useful).

Take user input of the first date for a variable number of sessions per week.
If for example three sessions:
Date 1 = input
Date 2 = input
Date 3 = input
Date 4 = Date1 + 7 etc.

Comparing to a holiday list that varies by market place before adding to the record in each case.

It looks like the thread you showed me has the basis to achieve this.
Thanks again and happy new year.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top