Count the holidays between dates

dhen21dx

New member
Local time
Tomorrow, 04:24
Joined
Aug 28, 2013
Messages
5
I have difficulty in building function for counting the holidays between dates, i used dcount however when converting it to function, not lucky as to have right result. Please help
 
Hi. Are you counting the holidays from a Holidays table?
 
dates need to be formatted as #mm/dd/yyyy# regardless of region. So probably something like

dcount("*","someQuery", "HolidayDate BETWEEN #" & format(me.startDate,"mm/dd/yyyy") & " AND #" & format(me.enddate,"mm/dd/yyyy") & "#")
 
Hello Yes, counting the holiday from the table between 2 dates. I just want to have function to count that and called in query however didnt success yet. Yes i have that formula, however i want to have it in function.
 
Hmm, then for the Function you can Dim the Start Date and the End Date, add your DCount() and then Call it via...

SQL:
fYourFunctionName(Me.txtStartDate, Me.txtEndDate)

You could just post what you have for us to take a look.
 

Users who are viewing this thread

Back
Top Bottom