calculated field

awake2424

Registered User.
Local time
Today, 03:05
Joined
Oct 31, 2007
Messages
479
Trying to calculate the integer difference between Due_Date and Result_Date excluding weekends and holidays.

I have a table (Holidays) with the dates of the holidays in it. The table looks like:

ID Description Holiday
1 New Years 1/1/2014
2 New Years 1/1/2015


So, if Date_Due: 9/25/2014 and Result_Date: 9/29/2014, then TAT = 2

Since 9/27/2014 and 9/28/2014 are weekends they are excluded from the calculation and only that Thursday and Friday are used in the calculation. I have tried many different functions and can not seem to figure this out. Thanks.

Code:
 Private Sub Result_Date_AfterUpdate()
    [TAT] = NETWORKDAYS(Due_Date, Result_Date, tblHolidays)
End Sub
 
You may have to post *your* NETWORKDAYS() Function since that is not a native Access Function.
 
I have also tried the two functions here:
http://www.access-programmers.co.uk/forums/showthread.php?t=269422

I did not know where best to post this, but have not been able to figure it out. The calculation seems to be including the weekend ( amd probably the holidays as well, but I am not sure. The NETWORKDAYS formula was a last ditch effort on my part as I really can not figure this out. Thanks.
 
I have also tried the two functions here:
http://www.access-programmers.co.uk/forums/showthread.php?t=269422

I did not know where best to post this, but have not been able to figure it out. The calculation seems to be including the weekend ( amd probably the holidays as well, but I am not sure. The NETWORKDAYS formula was a last ditch effort on my part as I really can not figure this out. Thanks.
There are many knowledgeable people here but AFAIK none of them are psychic. Unless you post the NETWORKDAYS() function it is unlikely, IMHO, that anyone will be able correct the problem you are having with it.
 
All I have for that is in post 1, it was a last ditch effort to try and make the calculation work. In the link there are two different functions, but neither seemed to work. Thank you.
 
You need to post the actual Function.

The Function will be made up of many words.

Also can you open your code and then do a Compile. This is important for us to know this.
 
This is the third thread you post on the same topic. In the first one, plog was kind enough to point out what you needed to do and that you needed to exercise care with how you call the function.

You did not follow plog's advice but just posted a new thread, and then a new one again. This is not conducive to progress. When something is not clear to you then ask - don't just ignore the advice and go off to post a new thread.
 
I will continue to post on that thread and apologize.
 

Users who are viewing this thread

Back
Top Bottom