Custom Function DCount

Mudbutt

Board Regular
Joined
Jul 18, 2011
Messages
158
I'm using Office 2007, I have a query in Access that is calculating NetWorkingDays. This query accounts for Holidays, in which I reference in a table. However, in order to account for that, I have to use DCount in my formula. This query needs to be linked to an Excel report via a QueryTable. However, it doesn't seem Excel likes the DCount formula because it will not let me connect the query saying that it can't find my "tblHolidays" table.

Does anyone know how to get around this? I tried creating a custom function as well and using the function, but then Excel didn't recognize the function because it was created in Access. Here is my formula that I use to calculate the networking days.
Code:
WorkDayDiff: -(([Req#dlv#dt]-[Act Date])-(DateDiff("ww",[Act Date],[Req#dlv#dt])*2))-DCount("[Holidays]","tblHolidays","[Holidays] > #" & [Act Date] & "# and [Holidays] < #" & [Req#dlv#dt] & "#")
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Thanks for informing me of this! I wasn't sure which section it was more appropriate in considering it relates to both Excel and Access.
 
Upvote 0
That's fine. We just ask that you mention it in both thread (and provide links) so people can see that it might be answered elsewhere.
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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