Counting Workdays in Access

dchaney

Well-known Member
Joined
Jun 4, 2008
Messages
732
Office Version
  1. 2016
Platform
  1. Windows
Hello all, if this was answered already I am sorry. I did a search and did not find anything.

Anyway, I have to create a report on a weekly basis for a customer. Currently I do this in Excel, but I pull all of the data from access. So to save time I am trying to set it up to pull the info and use it in access. I have used the assistance from Counting the Number of Working Days in Access 2007 to create what I am looking for, however there are issues. If I do not have an endDate I get the dredded #Error. How do I have the formula show me the days that have been worked, minus weekends and holidays within Access?

I used the VBA code from the above link and in my Query I have Working days: IIf(IsError(Workdays([Gate1Date],[ResolvedDate])),Workdays([Gate1Date],Date()),Workdays([Gate1Date],[ResolvedDate]))

This code works, but still getting the #Error...

Please help
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Access does not have a built in Workdays() function Do you have a User Defined Function (UDF) named Workdays()?

Assuming you have a UDF for Workdays() then try this:

Code:
Working days: Workdays([Gate1Date],IIF(IsDate([ResolvedDate]), [ResolvedDate], Date()) )


Here is a WorkDays() fuction
http://msdn.microsoft.com/en-us/library/dd327646(v=office.12).aspx

TIP: Use the "Go Advanced" option to get the expanded editor. The use the "#" tool button for the tag for code.
 
Upvote 0
That is the exact link I used to get the info I needed for the VBA.. the code you gave works like a charm, THANK YOU SO MUCH...
 
Upvote 0

Forum statistics

Threads
1,215,782
Messages
6,126,872
Members
449,345
Latest member
CharlieDP

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top