I need to caluclate the number of business hours (excludes weekends and holidays) between two date/time fields. The hours need to be based on a Mon-Fri 8:00am to 5:00pm work week. I currently calculate days with the formula below. There is a Holidays table which lists the holidays.
Days: IIf((DateDiff("d",[OPEN_TIME],[CLOSE_TIME])-(DateDiff("ww",[OPEN_TIME],[CLOSE_TIME])*2)+1-[HolidaysR])<0,1,(DateDiff("d",[OPEN_TIME],[CLOSE_TIME])-(DateDiff("ww",[OPEN_TIME],[CLOSE_TIME])*2)+1-[HolidaysR]))
Any ideas?
Thanks!
Days: IIf((DateDiff("d",[OPEN_TIME],[CLOSE_TIME])-(DateDiff("ww",[OPEN_TIME],[CLOSE_TIME])*2)+1-[HolidaysR])<0,1,(DateDiff("d",[OPEN_TIME],[CLOSE_TIME])-(DateDiff("ww",[OPEN_TIME],[CLOSE_TIME])*2)+1-[HolidaysR]))
Any ideas?
Thanks!