All -
I am needing to calculate the difference in hours between two date/time
fields (date format set to General for lack of a better idea). It would
seem relatively easy using the DateDiff function - however I need to
exclude weekend and holiday hours. Can someone advise on how to do this?
Can either this function or the Network days function be modified to
accommodate this?
And a further question if possible: since these two fields are required -
what is the syntax of the input mask for both a required date and a
required time? Nothing I've tried has been successful.
Thanks!
Jamie
Jamie,
<< I am needing to calculate the difference in hours between two date/time
fields (date format set to General for lack of a better idea). It would
seem relatively easy using the DateDiff function - however I need to
exclude weekend and holiday hours. >>
The syntax of the DateDiff function is this:
DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]])
To just count weekdays, make sure the interval is set to "w" instead
of "d". To get hours, use "h".
To exclude holidays, you'll have to manually list holidays and their dates
on a table; and then program your code to see if any holidays fall between
your start and end date, and then subtract them.
<< what is the syntax of the input mask for both a required date and a
required time? >>
The input mask is whatever you desire and set. DateDiff will work with
any input mask you give it.
Greg