Link to home
Start Free TrialLog in
Avatar of Cole100
Cole100Flag for United States of America

asked on

DateDiff function pulling wrong time duration

In my query Im attempting to calculate the exact time duration from clockin to clockout

I'm using this function to calculate the Duration field:
Duration: DateDiff("h"[clock_in_datetime],[clock_out_datetime])

The output for this is round numbers.  Is this avoidable?  I need the increments as well.

Clock_In_Datetime         Clock_Out_Datetime      Duration
9/3/2008 2:25:00 PM       9/3/2008 7:27:00 PM     5.00
9/3/2008 5:00:00 PM       9/3/2008 7:39:00 PM      2.0                                                                                
9/3/2008 5:03:00 PM       9/3/2008 8:22:00 PM      3.00
9/3/2008 5:13:00 PM       9/3/2008 8:27:00 PM      3.00
9/3/2008 6:35:00 PM       9/3/2008 10:14:00 PM    4.00                          
9/3/2008 8:11:00 PM       9/4/2008 1:34:00 AM      5.00

thanks



Avatar of tbsgadi
tbsgadi
Flag of Israel image

Hi Cole100,

You can use minutes "n"
http://www.techonthenet.com/access/functions/date/datediff.php

Good Luck!

Gary
ASKER CERTIFIED SOLUTION
Avatar of dportas
dportas

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 Cole100

ASKER

Using "n" gets total minutes.  I need hours rounded to the .1

clockin      clockout     duration (hrs)
4:00pm      8:30pm           4.5

thank you.

Avatar of Cole100

ASKER

dportas:

I should have caught that.  Thanks very much.  That got it.