Calculate Time Between Two Date/Time Fields

J

jlo

I have the expression using Datediff to extract the hours between two
date/time fields however, I am unclear on how to exclude Holidays and
Weekends.

Any help would be appreciated:

My fields are [TimeReceived] and [TimeAcknowledged]

I have a Holidays table with the fields [Holdate] and [Description]
 
R

Ron2006

Here are the basic tools you will need. You will have to decide how
you are going to count hours for these things.....


CountSaturday = (DateDiff("ww",[StartDate],[EndDate],7)
- this will tell you how many Saturdays.....




CountSundays = DateDiff("ww",[StartDate],[EndDate],1)
- this will tell you how may Sundays...


For Holidays

write a query that selects all records in that table between the
specified dates and use

holidaycnt= dCount ("[fieldnameinholidaytable]",
"theabovecreatedquery")
- This will tell you how many holidays.


Basically then, each of those counts times 24 will tell you how many
hours.

Ron
 

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