Link to home
Start Free TrialLog in
Avatar of seanmorris
seanmorris

asked on

Calculate number of hours between two datetime fields

I need to calculate the number of huors between two datetimes. Furthermore i need to exlude weekends.

e.g.
C                                         E
19/10/2006 19:39      23/10/2006 08:00
18/04/2007 00:04      18/04/2007 08:00
31/07/2007 20:03      01/08/2007 08:00
31/07/2007 19:27      01/08/2007 08:00
31/07/2007 20:36      01/08/2007 08:00
31/07/2007 19:45      01/08/2007 15:59
31/07/2007 18:09      01/08/2007 08:00
31/07/2007 20:24      01/08/2007 08:00

I can calulate the number of days using networkday, but i can quite figure out the number of hours.
Avatar of ry_ashpool
ry_ashpool

Not a fun solution you will need to come up with an algorithm to identify the weekends.

Just a question: Do C and E ever occur on weekends themselves.  If not the solution is a lot easier.
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of seanmorris

ASKER

Thanks  matthewspatrick

that is exactly what i was looking.

regards
sm