If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Time calculation
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 |
#2
|
|||
|
|||
Time calculation
Try:
= Int(SUM(UMWORKINGPERDAY) * 24) & Format( SUM(UMWORKINGPERDAY) , ":nn:ss" ) Vanderghast, Access MVP "Tia" wrote in message ... 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 |
#3
|
|||
|
|||
Time calculation
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 "Tia" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|