I've been learnig about dates and Access and was surprised to learn that there's no native function determine the number of weekdays between 2 dates as there is in Excel. I googled around and found a couple of functions that do that job, and have been noodling around with using one of the methods I found in various ways. Of course I quickly stumbled upon the fact if there's only one date of the required two, you get an error for a result. I imagine the real life application of something like this would have to work around this likely scenario. I'm just looking for a nudge in the right direction. Here's the function I've been experimenting with.
Code:
Public Function MyNetworkDays(startDate As Date, endDate As Date) As Long
Dim D As Date
MyNetworkDays = 0
D = startDate
While D < endDate
If Weekday(D) > 1 And Weekday(D) < 7 Then MyNetworkDays = MyNetworkDays + 1
D = D + 1
Wend
End Function