Time and billing help

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
 
P

Paul Shapiro

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.
 
J

John Spencer

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
 
T

Tom

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top