Link to home
Start Free TrialLog in
Avatar of Roman F
Roman FFlag for United States of America

asked on

Help me with Time Conversion in Access

I have StartDate and EndDate. How to find the difference in business hours and minutes
StartDate                      EndDate                       
5/20/2013 9:32      5/21/2013 16:24      
5/20/2013 9:32      5/21/2013 16:27      
5/20/2013 9:32      5/21/2013 16:29      
5/20/2013 9:32      5/21/2013 16:31      
I am using formula to convert to Minutes:
Minutes: DateDiff("n",[StartDate],[EndDate])
TurnAround Time: Int(([Minutes]\60)\24) & ":" & Format(([Minutes]\60) Mod 24,"00") & ":" & Format([Minutes] Mod 60,"00")
it does not work
and I need to  count only business (8 hours)
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

I would recommend you create a function for this.  Pass the function the two date/time values, then use some logic to determine whether:

1.  The two values are on the same date (then use datediff)
2.  If the two values are on two successive dates, in which case you have to do the date diff between date/time1 and your end of day (whatever time that is), and then another calculation for the difference between your start time and date/time2.
3.  If there is more than one day between them, you would need to do the same as #2, plus for the extra days, determine whether they are business days or not and add the appropriate number of minutes.
ASKER CERTIFIED SOLUTION
Avatar of Shaun Kline
Shaun Kline
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 Roman F

ASKER

Thank you, but i did not get
Avatar of Roman F

ASKER

To: Shaun_Kline thank you works fine