eckert1961
Registered User.
- Local time
- Yesterday, 20:23
- Joined
- Oct 25, 2004
- Messages
- 90
Hello,
I found the following code that I want to use in my database but I'm not sure how I can test it and implement it if it returns what I'm looking for.
Any suggestions?
Chris
I found the following code that I want to use in my database but I'm not sure how I can test it and implement it if it returns what I'm looking for.
Code:
Public Function countday(dt_from, dt_to)
'this function return an array of 7 integer (1 to 7) counting the number of
monday, tuesday ... in a period of time
'1 is monday, 2 is tuesday .... 7 is sunday
Dim dt_i, dt_0, dt_1 As Date
dt_0 = CDate(dt_from)
dt_1 = CDate(dt_to)
Dim day_count(1 To 7) As Integer
For dt_i = dt_0 To dt_1
day_count(Weekday(dt_i, vbMonday)) = day_count(Weekday(dt_i, vbMonday)) + 1
Next
countday = day_count()
End Function
Any suggestions?
Chris