Subtracting Holiday Hours

Q

Qaspec

I'm using the following expressions to calculate the number of hours between
[ZeroHour] and [ActualEndDate] subtracting the Saturday and Sunday Hours. I
also have a table [tblHolidays] with a [HolidayDate] field. Is it possible to
create an expression that would allow me to subtract holiday hours also? Do I
need to create a function?

Saturdays: DateDiff("ww",[ZeroHour],[ActualEndDate],7)*24
Sundays: DateDiff("ww",[ZeroHour],[ActualEndDate],1)*24

Elapsed Time:
(DateDiff("n",[ZeroHour],[ActualEndDate])/60-[Saturdays]-[Sundays])
 
J

John Spencer

Count the holidays between the two dates.

DCount("*","HolidayTable","Between " & Format(ZeroHour,"\#yyyy\-mm\-dd\#") &
" and " & Format(ActualEndDate,"\#yyyy\-mm\-dd\#") )

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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