Networkdays Function in Access 97

  • Thread starter Nabiyah Edwards via AccessMonster.com
  • Start date
N

Nabiyah Edwards via AccessMonster.com

Hello,

I'm pretty new to Access and new to the group as well. I want to say in
advance thank you for any assistance you may provide. I've already found
some thread "tremendously" help. It's a great to those with a wealth of
knowledge willing to help those trying to find their way :)

I'm trying to net the working days between two days. I don't to account for
holidays or anything, just the two dates. I found a couple of threads here
and on google but I can't seem to get them to work.

I'm using the following:
NetDays:dhCountWorkda­ysA([DCallRcvd],[TDCallRtrnd]) but I get an
"undefined dhCountWorkdaysA in expression" error message. Can anyone tell
me why? Both my fields being referenced are Date fields.

Thanks,
Ny
 
D

Douglas J. Steele

The reference to dhCountWorkda­ysA implies that you're using the code from
the VBA Developer's Handbook by Getz and Gilbert (the code's also available
at http://www.mvps.org/access/datetime/date0012.htm at "The Access Web",
courtesy of Ken Getz)

Did you save that code in a module? Does it compile cleanly? Can you use the
code in VB (or in the Immediate Window, which you get to using Ctrl-G)? What
did you name the module? (modules can't be named the same as subs/functions
contained within them)
 
N

Nabiyah Edwards via AccessMonster.com

Thanks Lynn and Douglas, I really appreciate both of your help. I actually
found something on this site that worked, after a little more digging.

I don't know who came up with this but it's brilliant, and just what the
doctor ordered! This site is wonderful. Thanks Again : )

Here's what I need for my query in Access:

NetDays: DateDiff("d", dte1, dte2) - DateDiff("ww", dte1, dte2, 1) * 2 -
IIf(Weekday(dte2, 1) = 7, IIf(Weekday(dte1, 1) = 7, 0, 1),
IIf(Weekday(dte1, 1) = 7, -1, 0))
 
N

Nabiyah Edwards via AccessMonster.com

Thanks Lynn and Douglas, I really appreciate both of your help. I actually
found something on this site that worked, after a little more digging.

I don't know who came up with this but it's brilliant, and just what the
doctor ordered! This site is wonderful. Thanks Again : )

Here's what I worked for my query in Access:

NetDays: DateDiff("d", dte1, dte2) - DateDiff("ww", dte1, dte2, 1) * 2 -
IIf(Weekday(dte2, 1) = 7, IIf(Weekday(dte1, 1) = 7, 0, 1),
IIf(Weekday(dte1, 1) = 7, -1, 0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top