Time calculation

T

Tia

Hello,
I am working on the employee attendance data entry the time in and out
are based on short time format
i have created a report sorted by employee ID and by making the sum of
total hours per day in order to get how many wrking hours each
employee have im getting a wrong calculation
Example
ID Employee date totalk wrking hours
1 Tia 1/1/2010 16:00
1 Tia 1/1/2010 16:00
1 Tia 1/1/2010 16:00
1 Tia 1/1/2010 16:00
1 Tia 1/1/2010 16:00
1 Tia 1/1/2010 16:00
1 Tia 1/1/2010 16:00
1 Tia 1/1/2010 16:00
1 Tia 1/1/2010 15:45
1 Tia 1/1/2010 16:00
=Sum([UMWORKINGPERDAY]) 15:45
FORMAT SHORT TIME
WHAT I SHOULD GET IS 159:45:00
hOW CAN I MAKE THE CALCULATION

tHANK YOU IN ADVANCE
 
V

vanderghast

Try:


= Int(SUM(UMWORKINGPERDAY) * 24) & Format( SUM(UMWORKINGPERDAY) ,
":nn:ss" )


Vanderghast, Access MVP
 
D

Duane Hookom

Points in time are generally stored in date/time fields. Durations should be
stored in a numeric field such as a double for hours or similar. Is there a
reason why you don't calculate your wrking hours as actual hours and not a
point in time? Typically you would use the DateDiff("n",[Start],[End])
function to get the number of minutes worked. You can easily sum this and
divide by 60 to get hours. There are lots of answers on the web that show
how to convert hour values like 8.5 to look like 8:30. Again, 8.5 hrs seems
more descriptive than the time 8:30 which is about 1/2 hour later than I am
expected to arrive at work.

Duane Hookom
MS Access MVP
 

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