Time and billing help

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

instead of 7.5 . I am trying to make a simple database example to show
empoyee time tracking . I have
employeeid,emloyeename,starttime,luch,return,endtime as my fields.
Obviously, I want to make a formula (lunch-starttime)+(endtime-return) to
total the hours for the day. My problem is in the formatting. If a person
comes to work at 8:30 and lujch at 12 and returns at 1 and works till 5 .
That is 7 and a half hours . My answer comes out as 7.3 hrs if I format it as
time. If this were excel I know I could take the answer and multiply by 24
and take just the integers. It doesn't seem to work here. Any suggestions
would be greatly appreciated.
Thanks
Tom
 
Tom said:
I am trying to make a simple database example to show empoyee time
tracking .
I have employeeid,emloyeename,starttime,luch,return,endtime as my fields.
Obviously, I want to make a formula (lunch-starttime)+(endtime-return) to
total the hours for the day. My problem is in the formatting. If a person
comes to work at 8:30 and lujch at 12 and returns at 1 and works till 5 .
That is 7 and a half hours . My answer comes out as 7.3 hrs if I format it
as
time. If this were excel I know I could take the answer and multiply by 24
and take just the integers. It doesn't seem to work here. Any suggestions
would be greatly appreciated.
Thanks
Tom

If you include your code someone can give definitive answers. We can't see
how you're doing the computation or what datatypes you're using.
 
Take a look at the VBA DateDiff function. And use that to calculate the total
minutes and then divide by 60. Your expression will look like:

(DateDiff("n",StartTime,Lunch) + DateDiff("n",Return,EndTime)) /60

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
That worked perfectly. Thanks for the help!

Tom
John Spencer said:
Take a look at the VBA DateDiff function. And use that to calculate the total
minutes and then divide by 60. Your expression will look like:

(DateDiff("n",StartTime,Lunch) + DateDiff("n",Return,EndTime)) /60

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top