DateDiff Problem

N

neenmarie

I'm trying to return the value for employee hours on a project. Time tickets
are entered daily and the query is as follows:

IIf(DateDiff("h",[beg2],[end2])>0,DateDiff("h",[beg2],[end2]),(DateDiff("h",[beg2],[end2]))+24)

How do I include the minutes also. I'm getting 8:30 to 11:00 as 3 instead
of 2.5

Thank you
 
K

Ken Snell [MVP]

You will need to get the time difference in minutes, and then use that
number to convert to hours and fractional hours:

(IIf(DateDiff("h",[beg2],[end2])>0,DateDiff("n",[beg2],[end2]),(DateDiff("n",[beg2],[end2]))+(24*60)))
/ 60
 
Top