# 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)
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
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.
0
Try this to get the business minutes:
DateDiff("n", startdate, enddate) - DateDiff("d", startdate, enddate) * 16 * 60

You would need to check that enddate is greater than startdate.
0

Experts Exchange Solution brought to you by